mirror of
https://github.com/postgres/postgres.git
synced 2026-02-27 11:50:33 -05:00
Restore psql's SIGPIPE setting if popen() fails.
Ancient oversight in PageOutput(): if popen() fails, we'd better reset the SIGPIPE handler before returning stdout, because ClosePager() won't. Noticed while fixing the empty-PAGER issue.
This commit is contained in:
parent
ccb84dae13
commit
cf59a8a4fe
1 changed files with 4 additions and 0 deletions
|
|
@ -2220,6 +2220,10 @@ PageOutput(int lines, unsigned short int pager)
|
|||
pagerpipe = popen(pagerprog, "w");
|
||||
if (pagerpipe)
|
||||
return pagerpipe;
|
||||
/* if popen fails, silently proceed without pager */
|
||||
#ifndef WIN32
|
||||
pqsignal(SIGPIPE, SIG_DFL);
|
||||
#endif
|
||||
#ifdef TIOCGWINSZ
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue