diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-10 09:12:56 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-10 09:12:56 +0000 |
commit | b50873653627be1bd12ae070667cb919d667a39a (patch) | |
tree | 7a05d65ccc4d6a4e6e58a516f7d8eae3a847df87 | |
parent | 9557ca00615d2a6e68785272357642779db26411 (diff) | |
download | skalibs-b50873653627be1bd12ae070667cb919d667a39a.tar.xz |
Fix child_spawn fd closing when n=1
-rw-r--r-- | src/libstddjb/child_spawn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstddjb/child_spawn.c b/src/libstddjb/child_spawn.c index 867f800..5d696e4 100644 --- a/src/libstddjb/child_spawn.c +++ b/src/libstddjb/child_spawn.c @@ -192,7 +192,7 @@ pid_t child_spawn (char const *prog, char const *const *argv, char const *const fd_close(syncpipe[0]) ; #endif - for (; i ; i--) + for (i = n ; i ; i--) { fd_close(p[i-1][i & 1]) ; fds[i-1] = p[i-1][!(i & 1)] ; |