mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Make failure to open psql's --log-file fatal.
Commit 344cdff2c 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
This commit is contained in:
parent
59f10ffa5b
commit
e90371d1a7
@ -274,8 +274,11 @@ main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
pset.logfile = fopen(options.logfilename, "a");
|
pset.logfile = fopen(options.logfilename, "a");
|
||||||
if (!pset.logfile)
|
if (!pset.logfile)
|
||||||
|
{
|
||||||
fprintf(stderr, _("%s: could not open log file \"%s\": %s\n"),
|
fprintf(stderr, _("%s: could not open log file \"%s\": %s\n"),
|
||||||
pset.progname, options.logfilename, strerror(errno));
|
pset.progname, options.logfilename, strerror(errno));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user