1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

In pg_upgrade, fix the -l/log option to work on Windows.

Also, double-quote the log file name in all places, to allow (on all
platforms) log file names with spaces.

Back patch to 9.0 and 9.1.
This commit is contained in:
Bruce Momjian
2011-07-20 18:31:03 -04:00
parent 6b43fddee4
commit 17a16eeb7c
5 changed files with 30 additions and 33 deletions

View File

@ -192,8 +192,15 @@ parseCommandLine(int argc, char *argv[])
pg_log(PG_FATAL, "cannot write to log file %s\n", log_opts.filename);
}
else
log_opts.filename = strdup(DEVNULL);
log_opts.filename = pg_strdup(DEVNULL);
/* WIN32 files do not accept writes from multiple processes */
#ifndef WIN32
log_opts.filename2 = pg_strdup(log_opts.filename);
#else
log_opts.filename2 = pg_strdup(DEVNULL);
#endif
/* if no debug file name, output to the terminal */
if (log_opts.debug && !log_opts.debug_fd)
{