diff options
| author | Dan Gohman <dev@sunfishcode.online> | 2021-08-12 22:00:06 -0700 |
|---|---|---|
| committer | Dan Gohman <dev@sunfishcode.online> | 2021-08-19 12:02:41 -0700 |
| commit | 6f872880b46d497166dfd33547c7b65125e35a26 (patch) | |
| tree | b16f6a9201eb40367f0c247884ac6c5e906422c8 /library/std/src/sys | |
| parent | 9b99f8c4544e5670d8d589fd9164d75da90817de (diff) | |
| download | rust-6f872880b46d497166dfd33547c7b65125e35a26.tar.gz rust-6f872880b46d497166dfd33547c7b65125e35a26.zip | |
Use the correct `into_*` on Windows to avoid dropping a stdio handle.
Use `into_raw_handle()` rather than `into_inner()` to completely consume a `Handle` without dropping its contained handle.
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/windows/process.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/windows/process.rs b/library/std/src/sys/windows/process.rs index 5cfde16faf0..ccff90629a3 100644 --- a/library/std/src/sys/windows/process.rs +++ b/library/std/src/sys/windows/process.rs @@ -15,7 +15,7 @@ use crate::io::{self, Error, ErrorKind}; use crate::mem; use crate::num::NonZeroI32; use crate::os::windows::ffi::OsStrExt; -use crate::os::windows::io::{AsRawHandle, FromRawHandle}; +use crate::os::windows::io::{AsRawHandle, FromRawHandle, IntoRawHandle}; use crate::path::Path; use crate::ptr; use crate::sys::c; @@ -371,7 +371,7 @@ impl Stdio { Ok(io) => unsafe { let io = Handle::from_raw_handle(io); let ret = io.duplicate(0, true, c::DUPLICATE_SAME_ACCESS); - io.into_inner(); + io.into_raw_handle(); ret }, Err(..) => unsafe { Ok(Handle::from_raw_handle(c::INVALID_HANDLE_VALUE)) }, |
