commit b50873653627be1bd12ae070667cb919d667a39a parent 9557ca00615d2a6e68785272357642779db26411 Author: Laurent Bercot <ska-skaware@skarnet.org> Date: Wed, 10 Dec 2014 09:12:56 +0000 Fix child_spawn fd closing when n=1 Diffstat:
M | src/libstddjb/child_spawn.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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)] ;