aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/pg_upgrade/exec.c4
-rw-r--r--src/bin/pg_upgrade/option.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/pg_upgrade/exec.c b/src/bin/pg_upgrade/exec.c
index 043373f9a5d..03633093282 100644
--- a/src/bin/pg_upgrade/exec.c
+++ b/src/bin/pg_upgrade/exec.c
@@ -146,7 +146,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
#endif
if (log == NULL)
- pg_fatal("could not write to log file \"%s\"\n", log_file);
+ pg_fatal("could not open log file \"%s\": %m\n", log_file);
#ifdef WIN32
/* Are we printing "command:" before its output? */
@@ -201,7 +201,7 @@ exec_prog(const char *log_file, const char *opt_log_file,
* log these commands to a third file, but that just adds complexity.
*/
if ((log = fopen(log_file, "a")) == NULL)
- pg_fatal("could not write to log file \"%s\"\n", log_file);
+ pg_fatal("could not write to log file \"%s\": %m\n", log_file);
fprintf(log, "\n\n");
fclose(log);
#endif
diff --git a/src/bin/pg_upgrade/option.c b/src/bin/pg_upgrade/option.c
index 873d1d07e48..73f395f2a35 100644
--- a/src/bin/pg_upgrade/option.c
+++ b/src/bin/pg_upgrade/option.c
@@ -217,7 +217,7 @@ parseCommandLine(int argc, char *argv[])
}
if ((log_opts.internal = fopen_priv(INTERNAL_LOG_FILE, "a")) == NULL)
- pg_fatal("could not write to log file \"%s\"\n", INTERNAL_LOG_FILE);
+ pg_fatal("could not open log file \"%s\": %m\n", INTERNAL_LOG_FILE);
if (log_opts.verbose)
pg_log(PG_REPORT, "Running in verbose mode\n");
@@ -226,7 +226,7 @@ parseCommandLine(int argc, char *argv[])
for (filename = output_files; *filename != NULL; filename++)
{
if ((fp = fopen_priv(*filename, "a")) == NULL)
- pg_fatal("could not write to log file \"%s\"\n", *filename);
+ pg_fatal("could not write to log file \"%s\": %m\n", *filename);
/* Start with newline because we might be appending to a file. */
fprintf(fp, "\n"