]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #82949 - the8472:forget-envlock-on-fork, r=joshtriplett
authorDylan DPC <dylan.dpc@gmail.com>
Wed, 10 Mar 2021 16:55:43 +0000 (17:55 +0100)
committerGitHub <noreply@github.com>
Wed, 10 Mar 2021 16:55:43 +0000 (17:55 +0100)
commitd01648b60e74ae12e990b0858e68023504b9bd29
tree4ebaa90d3fba92e860c394c2150027ef633d48b1
parent881bbb758a928b60d790936280d4ee3c38e05eaf
parentd854789ce191be25f2953c60fd50ce711776d9eb
Rollup merge of #82949 - the8472:forget-envlock-on-fork, r=joshtriplett

Do not attempt to unlock envlock in child process after a fork.

This implements the first two points from https://github.com/rust-lang/rust/issues/64718#issuecomment-793030479

This is a breaking change for cases where the environment is accessed in a Command::pre_exec closure. Except for single-threaded programs these uses were not correct anyway since they aren't async-signal safe.

Note that we had a ui test that explicitly tried `env::set_var` in `pre_exec`. As expected it failed with these changes when I tested locally.
library/std/src/sys/unix/ext/process.rs
library/std/src/sys/unix/process/process_unix.rs