You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
system.c: Avoid double close of file descriptor in child process.
Inside the child process, after we fork or clone, we close most file
descriptors as is customary. If we are launching a container using
clone, we already exempt procpipe[0] since we actually need that
after we close the other file descriptors.
In the case that fdout is -1 (consumer doesn't want the output), we
create a dummy pipe that is used to receive output from the child
and throw it away. As is customary, we immediately close the read
end of the pipe in the child, since only the parent needs that.
This wasn't being passed to cleanup_fds as an exemption, leading to
a double close (and a valgrind warning that was non-fatal to the
tests). Pass it in as exempted (since it was already closed) to avoid
the double close and accompanying warning.
0 commit comments