summaryrefslogtreecommitdiffstats
path: root/lib/Utils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-05-04 16:24:53 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-05-04 16:24:53 +0200
commit3d6f441673de51cdd419cd2fd74f4e22f47b0617 (patch)
treed7b5c6836830017f55ed8eeb1a8e1f57e7114475 /lib/Utils
parent4c2a95c3e1e29cf6e99d85e368b4ef457150986d (diff)
downloadabrt-3d6f441673de51cdd419cd2fd74f4e22f47b0617.tar.gz
abrt-3d6f441673de51cdd419cd2fd74f4e22f47b0617.tar.xz
abrt-3d6f441673de51cdd419cd2fd74f4e22f47b0617.zip
fork_execv_on_steroids: close other end of the pipe in the child
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils')
-rw-r--r--lib/Utils/spawn.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Utils/spawn.cpp b/lib/Utils/spawn.cpp
index 54d08a4a..43bc9540 100644
--- a/lib/Utils/spawn.cpp
+++ b/lib/Utils/spawn.cpp
@@ -67,11 +67,13 @@ pid_t fork_execv_on_steroids(int flags,
/* Play with stdio descriptors */
if (flags & EXECFLG_INPUT) {
xmove_fd(pipe_to_child[0], STDIN_FILENO);
+ close(pipe_to_child[1]);
} else if (flags & EXECFLG_INPUT_NUL) {
xmove_fd(xopen("/dev/null", O_RDWR), STDIN_FILENO);
}
if (flags & EXECFLG_OUTPUT) {
xmove_fd(pipe_fm_child[1], STDOUT_FILENO);
+ close(pipe_to_child[0]);
} else if (flags & EXECFLG_OUTPUT_NUL) {
xmove_fd(xopen("/dev/null", O_RDWR), STDOUT_FILENO);
}