diff options
author | Bruce Momjian <bruce@momjian.us> | 2010-06-22 16:45:10 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2010-06-22 16:45:10 +0000 |
commit | 601d1eeddc974fbde230c2159e6b95200cfb355f (patch) | |
tree | ae95be272c137bc3a2fbf386fdec2a89b78e7633 /contrib/pg_upgrade/option.c | |
parent | 7b6f29006ec5a4e8d9d78c5184940aee31ff40e0 (diff) |
Fix pg_upgrade's use of pg_ctl on Win32 to not send command and sever
output to the same file, because it is impossible.
Also set user name for pg_dumpall in pg_upgrade.
Diffstat (limited to 'contrib/pg_upgrade/option.c')
-rw-r--r-- | contrib/pg_upgrade/option.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/pg_upgrade/option.c b/contrib/pg_upgrade/option.c index a38a9a80fff..58606dd2bf3 100644 --- a/contrib/pg_upgrade/option.c +++ b/contrib/pg_upgrade/option.c @@ -174,12 +174,10 @@ parseCommandLine(migratorContext *ctx, int argc, char *argv[]) * start. */ /* truncate */ - ctx->log_fd = fopen(ctx->logfile, "w"); - if (!ctx->log_fd) + if ((ctx->log_fd = fopen(ctx->logfile, "w")) == NULL) pg_log(ctx, PG_FATAL, "Cannot write to log file %s\n", ctx->logfile); fclose(ctx->log_fd); - ctx->log_fd = fopen(ctx->logfile, "a"); - if (!ctx->log_fd) + if ((ctx->log_fd = fopen(ctx->logfile, "a")) == NULL) pg_log(ctx, PG_FATAL, "Cannot write to log file %s\n", ctx->logfile); } else |