X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fpipecmd%2Fpipecmd.c;h=c97fa312396dbb728e9cdceb6b795e21f6ee33da;hp=671d39198089b424f00e3f5041a7d79291ec55f8;hb=dd204de80d65e1ef22e90d207a816b7ef6a2e548;hpb=aae40e493625a07f4ac95476664447546b28661a diff --git a/ccan/pipecmd/pipecmd.c b/ccan/pipecmd/pipecmd.c index 671d3919..c97fa312 100644 --- a/ccan/pipecmd/pipecmd.c +++ b/ccan/pipecmd/pipecmd.c @@ -101,10 +101,12 @@ pid_t pipecmdarr(int *fd_fromchild, int *fd_tochild, char *const *arr) close(execfail[1]); /* Child will close this without writing on successful exec. */ if (read(execfail[0], &err, sizeof(err)) == sizeof(err)) { + close(execfail[0]); waitpid(childpid, NULL, 0); errno = err; return -1; } + close(execfail[0]); if (fd_tochild) *fd_tochild = tochild[1]; if (fd_fromchild)