summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-12-10 09:12:56 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-12-10 09:12:56 +0000
commitb50873653627be1bd12ae070667cb919d667a39a (patch)
tree7a05d65ccc4d6a4e6e58a516f7d8eae3a847df87
parent9557ca00615d2a6e68785272357642779db26411 (diff)
downloadskalibs-b50873653627be1bd12ae070667cb919d667a39a.tar.xz
Fix child_spawn fd closing when n=1
-rw-r--r--src/libstddjb/child_spawn.c2
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)] ;