displaytextitem: check popen() - sacc - sacc(omys), simple console gopher client
(HTM) git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) LICENSE
---
(DIR) commit 802d765ffd723b0e3298d6f070bf5301ae0ddadd
(DIR) parent e1eceee39ab489e5bc8ead2f8244b0cad3d1618f
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sun, 25 Feb 2018 16:32:48 +0100
displaytextitem: check popen()
$PAGER is always set, but this might fail if resource limits or other
restrictions are set.
Diffstat:
M sacc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/sacc.c b/sacc.c
@@ -248,7 +248,8 @@ displaytextitem(Item *item)
return;
case 0:
parent = 0;
- pagerin = popen("$PAGER", "we");
+ if (!(pagerin = popen("$PAGER", "we")))
+ _exit(1);
fputs(item->raw, pagerin);
exit(pclose(pagerin));
default: