projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ec5cc0
)
Restore psql's SIGPIPE setting if popen() fails.
author
Tom Lane
<
[email protected]
>
Wed, 7 Dec 2016 17:39:24 +0000
(12:39 -0500)
committer
Tom Lane
<
[email protected]
>
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/bin/psql/print.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/psql/print.c
b/src/bin/psql/print.c
index bf5f4ff567118316ef509fab4ae276a2fd1de82c..8809cfa8b85a77e328c9600ff438802b97eda4ef 100644
(file)
--- a/
src/bin/psql/print.c
+++ b/
src/bin/psql/print.c
@@
-2087,6
+2087,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