aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-07-19 16:23:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-07-19 16:23:17 +0000
commit5b8b137b1635481cb5168e615260147b3878513f (patch)
treeb0ba471bf1ee804d5633c4861c2d479d5d797762 /src
parent9d9a65bfa714055770210ee13af566b3d8b80e49 (diff)
downloadpostgresql-5b8b137b1635481cb5168e615260147b3878513f.tar.gz
postgresql-5b8b137b1635481cb5168e615260147b3878513f.zip
Adjust pg_regress to print out the exact string given to system() when
'make install' or 'initdb' fails. Also minor simplification of fgets() usage --- fgets guarantees a trailing null anyway.
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/pg_regress.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index f30994ea0ad..1704da5033d 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.3 2006/07/19 05:21:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.4 2006/07/19 16:23:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -320,8 +320,8 @@ load_resultmap(void)
progname, buf, strerror(errno));
exit_nicely(2);
}
- memset(buf, 0, sizeof(buf));
- while (fgets(buf, sizeof(buf)-1, f))
+
+ while (fgets(buf, sizeof(buf), f))
{
char *platform;
char *expected;
@@ -969,8 +969,7 @@ run_schedule(const char *schedule)
exit_nicely(2);
}
- memset(scbuf, 0, sizeof(scbuf));
- while (fgets(scbuf, sizeof(scbuf)-1, scf))
+ while (fgets(scbuf, sizeof(scbuf), scf))
{
char *test = NULL;
char *c;
@@ -1396,7 +1395,7 @@ main(int argc, char *argv[])
makeprog, top_builddir, temp_install, outputdir);
if (system(buf))
{
- fprintf(stderr, _("\n%s: installation failed\nExamine %s/log/install.log for the reason.\n"), progname, outputdir);
+ fprintf(stderr, _("\n%s: installation failed\nExamine %s/log/install.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf);
exit_nicely(2);
}
@@ -1410,7 +1409,7 @@ main(int argc, char *argv[])
outputdir);
if (system(buf))
{
- fprintf(stderr, _("\n%s: initdb failed\nExamine %s/log/initdb.log for the reason.\n"), progname, outputdir);
+ fprintf(stderr, _("\n%s: initdb failed\nExamine %s/log/initdb.log for the reason.\nCommand was: %s\n"), progname, outputdir, buf);
exit_nicely(2);
}