diff options
author | Nathan Straz <nstraz@redhat.com> | 2013-09-06 11:49:07 -0400 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2013-09-11 17:51:44 -0400 |
commit | ea6e0450c85776ee4a578be239b87309fdc1142c (patch) | |
tree | d7d371a289ec105895860520d0a42c561ddee944 | |
parent | 6e91fab5136433c1c2dc2f84304b848f078e97e4 (diff) | |
download | qarsh-ea6e0450c85776ee4a578be239b87309fdc1142c.tar.gz qarsh-ea6e0450c85776ee4a578be239b87309fdc1142c.tar.xz qarsh-ea6e0450c85776ee4a578be239b87309fdc1142c.zip |
Close both ends of the pipes so we don't leak file descriptors
-rw-r--r-- | qarshd.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -127,6 +127,9 @@ run_cmd(const char *cmd) dup2(parentfds[1], fileno(stdout)); dup2(parentfds[2], fileno(stderr)); /* close end of pipes we're not using */ + close(parentfds[0]); + close(parentfds[1]); + close(parentfds[2]); close(childfds[0]); close(childfds[1]); close(childfds[2]); |