8000 Make failure to open psql's --log-file fatal. · home201448/postgres@e90371d · GitHub
[go: up one dir, main page]

Skip to content

Commit e90371d

Browse files
committed
Make failure to open psql's --log-file fatal.
Commit 344cdff made failure to open the target of --output fatal. For consistency, the --log-file switch should behave similarly. Like the previous commit, back-patch to 9.5 but no further. Daniel Verite
1 parent 59f10ff commit e90371d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bin/psql/startup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,11 @@ main(int argc, char *argv[])
274274
{
275275
pset.logfile = fopen(options.logfilename, "a");
276276
if (!pset.logfile)
277+
{
277278
fprintf(stderr, _("%s: could not open log file \"%s\": %s\n"),
278279
pset.progname, options.logfilename, strerror(errno));
280+
exit(EXIT_FAILURE);
281+
}
279282
}
280283

281284
/*

0 commit comments

Comments
 (0)
0