projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18f8f78
)
Restore psql's SIGPIPE setting if popen() fails.
author
Tom Lane
<tgl@sss.pgh.pa.us>
Wed, 7 Dec 2016 17:39:24 +0000
(12:39 -0500)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Wed, 7 Dec 2016 17:39:24 +0000
(12:39 -0500)
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.
src/fe_utils/print.c
patch
|
blob
|
blame
|
history
diff --git
a/src/fe_utils/print.c
b/src/fe_utils/print.c
index 5c5d285be5f2095f4f84b8514d7969572c926c86..daa23d1955ae80f715057238d73ee17086915bf6 100644
(file)
--- a/
src/fe_utils/print.c
+++ b/
src/fe_utils/print.c
@@
-2884,6
+2884,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();
}
}