Don't leak a file descriptor in commonChildInit()

This commit is contained in:
Eelco Dolstra 2012-03-05 20:28:09 +01:00
parent 1d487dc6a6
commit 7b22bec252

View file

@ -367,6 +367,7 @@ void commonChildInit(Pipe & logPipe)
throw SysError(format("cannot open `%1%'") % pathNullDevice); throw SysError(format("cannot open `%1%'") % pathNullDevice);
if (dup2(fdDevNull, STDIN_FILENO) == -1) if (dup2(fdDevNull, STDIN_FILENO) == -1)
throw SysError("cannot dup null device into stdin"); throw SysError("cannot dup null device into stdin");
close(fdDevNull);
} }