projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
914b130
)
Prevent pg_upgrade from crashing if it can't write to the current
author
Bruce Momjian
<bruce@momjian.us>
Fri, 10 Aug 2012 21:14:48 +0000
(17:14 -0400)
committer
Bruce Momjian
<bruce@momjian.us>
Fri, 10 Aug 2012 21:14:48 +0000
(17:14 -0400)
directory.
Backpatch to 9.2.
contrib/pg_upgrade/util.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/pg_upgrade/util.c
b/contrib/pg_upgrade/util.c
index 1c7120471f88580dff59d11cffad7934741c3493..2c0dfd65e4e970878fe8ed6d7a8522ed67a9187d 100644
(file)
--- a/
contrib/pg_upgrade/util.c
+++ b/
contrib/pg_upgrade/util.c
@@
-78,7
+78,8
@@
pg_log(eLogType type, char *fmt,...)
va_end(args);
/* PG_VERBOSE is only output in verbose mode */
- if (type != PG_VERBOSE || log_opts.verbose)
+ /* fopen() on log_opts.internal might have failed, so check it */
+ if ((type != PG_VERBOSE || log_opts.verbose) && log_opts.internal != NULL)
{
fwrite(message, strlen(message), 1, log_opts.internal);
/* if we are using OVERWRITE_MESSAGE, add newline to log file */