about summary refs log tree commit diff
path: root/src/libstd/sys/windows/process.rs
diff options
context:
space:
mode:
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>2019-05-27 16:51:29 +0200
committerHugo Beauzée-Luyssen <hugo@beauzee.fr>2019-07-25 21:30:08 +0200
commita713a0399a6e63de1c8009a390ae964ff03f4067 (patch)
tree9154a6d4ac29ade41d40fca9933f67332431ed7d /src/libstd/sys/windows/process.rs
parent9407ed759fd31fca3c32c1bc3b3e2f26313c462f (diff)
downloadrust-a713a0399a6e63de1c8009a390ae964ff03f4067.tar.gz
rust-a713a0399a6e63de1c8009a390ae964ff03f4067.zip
std: win: Don't use SetHandleInformation on UWP
Attempt to create sockets with the WSA_FLAG_NO_HANDLE_INHERIT flag, and
handle the potential error gracefully (as the flag isn't support on
Windows 7 before SP1)
Diffstat (limited to 'src/libstd/sys/windows/process.rs')
-rw-r--r--src/libstd/sys/windows/process.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs
index e39b7ae8890..05e0ca67064 100644
--- a/src/libstd/sys/windows/process.rs
+++ b/src/libstd/sys/windows/process.rs
@@ -267,13 +267,8 @@ impl Stdio {
 
             Stdio::MakePipe => {
                 let ours_readable = stdio_id != c::STD_INPUT_HANDLE;
-                let pipes = pipe::anon_pipe(ours_readable)?;
+                let pipes = pipe::anon_pipe(ours_readable, true)?;
                 *pipe = Some(pipes.ours);
-                cvt(unsafe {
-                    c::SetHandleInformation(pipes.theirs.handle().raw(),
-                                            c::HANDLE_FLAG_INHERIT,
-                                            c::HANDLE_FLAG_INHERIT)
-                })?;
                 Ok(pipes.theirs.into_handle())
             }