rust/library/std/src
bors 01fbc5ae78 Auto merge of #103459 - ChrisDenton:propagate-nulls, r=thomcc
Pass on null handle values to child process

Fixes #101645

In Windows, stdio handles are (semantically speaking) `Option<Handle>` where `Handle` is a non-zero value. When spawning a process with `Stdio::Inherit`, Rust currently turns zero values into `-1` values. This has the unfortunate effect of breaking console subprocesses (which typically need stdio) that are spawned from gui applications (that lack stdio by default) because the console process won't be assigned handles from the newly created console (as they usually would in that situation). Worse, `-1` is actually [a valid handle](https://doc.rust-lang.org/std/os/windows/io/struct.OwnedHandle.html) which means "the current process". So if a console process, for example, waits on stdin and it has a `-1` value then the process will end up waiting on itself.

This PR fixes it by propagating the nulls instead of converting them to `-1`.

While I think the current behaviour is a mistake, changing it (however justified) is an API change so I think this PR should at least have some input from t-libs-api. So choosing at random...

r? `@joshtriplett`
2022-12-07 13:52:52 +00:00
..
backtrace Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
collections Added const_hash tracking issue id 2022-11-06 18:01:44 +01:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error remove fn backtrace 2022-08-01 20:10:40 +00:00
f32 Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
f64 Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
ffi Guarantee try_reserve preserves the contents on error 2022-08-10 01:51:38 +09:00
fs Ignore hiberfil_sys test in CI 2022-07-18 15:06:07 +01:00
io Fix grammar in docs for std::io::Read 2022-10-24 01:06:34 -07:00
net Remove unused diagnostic items 2022-11-13 18:49:21 +00:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os enable fuzzy_provenance_casts lint in libstd 2022-11-20 19:23:28 +01:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path make many std tests work in Miri 2022-08-18 18:07:39 -04:00
personality enable fuzzy_provenance_casts lint in libstd 2022-11-20 19:23:28 +01:00
prelude Gate macros behind #[cfg(not(bootstrap))] 2022-12-01 11:16:18 +01:00
process Add test for issue #95178 2022-03-23 05:33:44 +00:00
sync Rollup merge of #105243 - RalfJung:no-op-let, r=Mark-Simulacrum 2022-12-06 13:27:42 +01:00
sys Auto merge of #103459 - ChrisDenton:propagate-nulls, r=thomcc 2022-12-07 13:52:52 +00:00
sys_common Auto merge of #104160 - Ayush1325:windows-args, r=m-ou-se 2022-12-01 01:22:32 +00:00
thread fix dupe word typos 2022-12-05 16:42:36 +08:00
time Fix non-associativity of Instant math on aarch64-apple-darwin targets 2022-11-13 12:01:42 -08:00
alloc.rs Forbid mixing System with sytem allocator calls 2022-09-03 16:47:12 -05:00
ascii.rs Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
backtrace.rs std: use sync::Mutex for internal statics 2022-10-13 12:55:14 +02:00
env.rs env::temp_dir: fix a typo 2022-09-28 21:51:09 +02:00
error.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
f32.rs Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
f64.rs Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
fs.rs Rollup merge of #105100 - jhpratt:fix-docs, r=JohnTitor 2022-12-03 12:51:28 +09:00
keyword_docs.rs review feedback 2022-10-07 15:21:47 +02:00
lib.rs Rollup merge of #104647 - RalfJung:alloc-strict-provenance, r=thomcc 2022-11-22 22:54:41 -05:00
macros.rs stdio: Document no support for writing to non-blocking stdio/stderr 2022-09-07 14:22:57 +01:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Adding backtrace off option for fuchsia targets 2022-09-14 23:54:40 +00:00
panicking.rs Adjust inlining attributes around panic_immediate_abort 2022-11-29 09:24:01 -05:00
path.rs Add as_mut_os_string to &mut PathBuf and as_mut_os_str to &mut Path 2022-11-28 12:06:59 -05:00
personality.rs Move personality functions to std 2022-08-23 16:12:58 +08:00
primitive_docs.rs disable strict-provenance-violating doctests in Miri 2022-11-22 11:49:02 +01:00
process.rs Make diagnostic for unsatisfied Termination bounds more precise 2022-10-17 12:08:46 +02:00
rt.rs Change process spawning to inherit the parent's signal mask by default 2022-10-20 14:53:38 -07:00
time.rs Bump version placeholders to release 2022-11-06 17:11:02 -05:00