Content-Length: 259119 | pFad | http://github.com/postgrespro/postgres/commit/85642ec00b5e0c58d2504b10c079693b8fb28cc5

B8 Prevent pg_upgrade from crashing if it can't write to the current · postgrespro/postgres@85642ec · GitHub
Skip to content

Commit 85642ec

Browse files
committed
Prevent pg_upgrade from crashing if it can't write to the current
directory. Backpatch to 9.2.
1 parent 914b130 commit 85642ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/pg_upgrade/util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ pg_log(eLogType type, char *fmt,...)
7878
va_end(args);
7979

8080
/* PG_VERBOSE is only output in verbose mode */
81-
if (type != PG_VERBOSE || log_opts.verbose)
81+
/* fopen() on log_opts.internal might have failed, so check it */
82+
if ((type != PG_VERBOSE || log_opts.verbose) && log_opts.internal != NULL)
8283
{
8384
fwrite(message, strlen(message), 1, log_opts.internal);
8485
/* if we are using OVERWRITE_MESSAGE, add newline to log file */

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/85642ec00b5e0c58d2504b10c079693b8fb28cc5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy