This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #77672] avoid a file handle redirection race
authorTony Cook <tony@develop-help.com>
Mon, 3 Feb 2014 03:39:46 +0000 (14:39 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 3 Feb 2014 03:39:46 +0000 (14:39 +1100)
commitf06c882585eac59ec68dbf93c87659cb62a24000
tree6e53a963e5b33648ceec5ba79e082f24ab33d1c0
parent6034ee449826f1beaab7cee35d86aad5a3b6caef
[perl #77672] avoid a file handle redirection race

With multiple threads (and Win32 fork() is implemented in terms of
threads), Win32's popen() code had a race condition where a different
thread could write to the stdout (or read from the stdin) handle setup
for a child process.

Avoid this by using the Win32 API to supply the I/O handles instead of
redirecting them in the current process.
MANIFEST
t/win32/popen.t [new file with mode: 0644]
win32/win32.c