summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2017-04-05 12:35:01 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2017-04-05 12:35:01 (GMT)
commit10fcfaf0b5db1ad975f81fa7eba8dd8fa39931db (patch) (side-by-side diff)
treee4755427ad2548d7bc720931b0b6a908ef3fe93a
parent6639d5376f5d94f48ba753544adeeb958cef0590 (diff)
downloadjumper-10fcfaf0b5db1ad975f81fa7eba8dd8fa39931db.tar.gz
jumper-10fcfaf0b5db1ad975f81fa7eba8dd8fa39931db.tar.bz2
Fix descriptor leak
* src/progman.c (progman_start): Close pipe ends.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/progman.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/progman.c b/src/progman.c
index 0f48b37..d59b7b7 100644
--- a/src/progman.c
+++ b/src/progman.c
@@ -538,6 +538,10 @@ progman_start(int type, listener_t *lp, struct grecs_locus *loc,
if (pid) {
/* master */
+ if (options & OPT_STDERR)
+ close(redir_fd[REDIR_ERR]);
+ if (options & OPT_STDOUT)
+ close(redir_fd[REDIR_OUT]);
process_register(lp, type, timeout, pid, redir_pid);
wordsplit_free(&ws);
return 0;

Return to:

Send suggestions and report system problems to the System administrator.