Skip to content

Commit b7e1ae2

Browse files
committed
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.
1 parent 18f8f78 commit b7e1ae2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/fe_utils/print.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,6 +2884,8 @@ PageOutput(int lines, const printTableOpt *topt)
28842884
pagerpipe = popen(pagerprog, "w");
28852885
if (pagerpipe)
28862886
return pagerpipe;
2887+
/* if popen fails, silently proceed without pager */
2888+
restore_sigpipe_trap();
28872889
}
28882890
}
28892891

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