mirror of
https://github.com/postgres/postgres.git
synced 2026-03-07 15:50:44 -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
370c7a863a
commit
93c78ba19b
1 changed files with 2 additions and 0 deletions
|
|
@ -2880,6 +2880,8 @@ PageOutput(int lines, const printTableOpt *topt)
|
|||
pagerpipe = popen(pagerprog, "w");
|
||||
if (pagerpipe)
|
||||
return pagerpipe;
|
||||
/* if popen fails, silently proceed without pager */
|
||||
restore_sigpipe_trap();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue