summaryrefslogtreecommitdiff
path: root/src/libstddjb
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb')
-rw-r--r--src/libstddjb/child_spawn1_internal.c4
1 files changed, 2 insertions, 2 deletions
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") ;