]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #37677 - jsen-:master, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 21 Nov 2016 20:37:24 +0000 (14:37 -0600)
committerGitHub <noreply@github.com>
Mon, 21 Nov 2016 20:37:24 +0000 (14:37 -0600)
libstd: support creation of anonymous pipe on WinXP/2K3

`PIPE_REJECT_REMOTE_CLIENTS` flag is not supported on Windows < VISTA, and every invocation of `anon_pipe` including attempts to pipe `std::process::Child`'s stdio fails.
This PR should work around this issue by performing a runtime check of windows version and conditionally omitting this flag on "XP and friends".

Getting the version should be probably moved out of the function `anon_pipe` itself (the OS version does not often change during runtime :) ), but:
 - I didn't find any precedent for this and assuming there's not much overhead (I hope windows does not perform any heuristics to find out it's own version, just fills couple of fields in the struct).
 - the code path is not especially performance sensitive anyway.


Trivial merge