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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy