Commit b7e1ae23 authored by Tom Lane's avatar Tom Lane

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.
parent 18f8f784
...@@ -2884,6 +2884,8 @@ PageOutput(int lines, const printTableOpt *topt) ...@@ -2884,6 +2884,8 @@ PageOutput(int lines, const printTableOpt *topt)
pagerpipe = popen(pagerprog, "w"); pagerpipe = popen(pagerprog, "w");
if (pagerpipe) if (pagerpipe)
return pagerpipe; return pagerpipe;
/* if popen fails, silently proceed without pager */
restore_sigpipe_trap();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment