Files
git/compat
Johannes Sixt 85e94b981e Do not leak pipe file handles into the child processes.
Windows's _pipe() by default allocates inheritable pipes. However,
when a spawn happens, we do not have a possiblility to close the unused
pipe ends in the child process. This is a problem.

Consider the following situation: The child process only reads from the
pipe and the parent process uses only the writable end; the parent even
closes the writable end. As it happens, the child at this time usually
still waits for input in a read(). But since the child has inherited
an open writable end, it does not get EOF and hangs ad infinitum.

For this reason, pipe handles must not be inheritable. At the first
glance, this is curious, since after all it is the purpose of pipes to be
inherited by child processes.  However, in all cases where this
inheritance is needed for a file descriptor, it is dup2()'d to stdin or
stdout anyway, and, lo and behold, Windows's dup2() creates inheritable
duplicates.
2007-01-19 16:35:16 +01:00
..
2007-01-19 16:24:48 +01:00
2007-01-19 16:24:48 +01:00
2006-12-20 13:45:55 -08:00
2006-12-24 00:29:43 -08:00