From eabd95d0385c9600ed5b75d37398498c19f64d9d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 18 Dec 2014 20:02:40 +0000 Subject: fd leak fix in child_spawn1_internal --- src/libstddjb/child_spawn1_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libstddjb/child_spawn1_internal.c b/src/libstddjb/child_spawn1_internal.c index 68b0242..6706b80 100644 --- a/src/libstddjb/child_spawn1_internal.c +++ b/src/libstddjb/child_spawn1_internal.c @@ -33,10 +33,10 @@ pid_t child_spawn1_internal (char const *prog, char const *const *argv, char con if (e) goto errattr ; e = posix_spawn_file_actions_init(&actions) ; if (e) goto errattr ; - e = posix_spawn_file_actions_addclose(&actions, p[!to]) ; - if (e) goto erractions ; e = posix_spawn_file_actions_adddup2(&actions, p[to], to) ; if (e) goto erractions ; + e = posix_spawn_file_actions_addclose(&actions, p[to]) ; + if (e) goto erractions ; if (!haspath && (setenv("PATH", SKALIBS_DEFAULTPATH, 0) < 0)) { e = errno ; goto erractions ; } e = posix_spawnp(&pid, prog, &actions, &attr, (char *const *)argv, (char *const *)envp) ; if (!haspath) unsetenv("PATH") ; -- cgit v1.2.3