diff options
| author | bors <bors@rust-lang.org> | 2021-02-13 02:46:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-02-13 02:46:57 +0000 |
| commit | 21cbbdc44de84e3ea99bca239091e5d1c49af654 (patch) | |
| tree | c971608c75fc98dd65787e909375c93744b563da /library/std/src/sys/unix/process/process_unix.rs | |
| parent | 3f5aee2d5241139d808f4fdece0026603489afd1 (diff) | |
| parent | 1ef566fc7c72a5e15ffd54334c744b6638b24374 (diff) | |
| download | rust-21cbbdc44de84e3ea99bca239091e5d1c49af654.tar.gz rust-21cbbdc44de84e3ea99bca239091e5d1c49af654.zip | |
Auto merge of #82045 - Dylan-DPC:rollup-244l0sb, r=Dylan-DPC
Rollup of 10 pull requests Successful merges: - #79775 (Fix injected errors when running doctests on a crate named after a keyword) - #81012 (Stabilize the partition_point feature) - #81479 (Allow casting mut array ref to mut ptr) - #81506 (HWAddressSanitizer support) - #81741 (Increment `self.index` before calling `Iterator::self.a.__iterator_ge…) - #81850 (use RWlock when accessing os::env) - #81911 (GAT/const_generics: Allow with_opt_const_param to return GAT param def_id) - #82022 (Push a `char` instead of a `str` with len one into a String) - #82023 (Remove unnecessary lint allow attrs on example) - #82030 (Use `Iterator::all` instead of open-coding it) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys/unix/process/process_unix.rs')
| -rw-r--r-- | library/std/src/sys/unix/process/process_unix.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs index 2746f87468d..9e82df7755e 100644 --- a/library/std/src/sys/unix/process/process_unix.rs +++ b/library/std/src/sys/unix/process/process_unix.rs @@ -47,7 +47,7 @@ impl Command { // a lock any more because the parent won't do anything and the child is // in its own process. let result = unsafe { - let _env_lock = sys::os::env_lock(); + let _env_lock = sys::os::env_read_lock(); cvt(libc::fork())? }; @@ -124,7 +124,7 @@ impl Command { // Similar to when forking, we want to ensure that access to // the environment is synchronized, so make sure to grab the // environment lock before we try to exec. - let _lock = sys::os::env_lock(); + let _lock = sys::os::env_read_lock(); let Err(e) = self.do_exec(theirs, envp.as_ref()); e @@ -404,7 +404,7 @@ impl Command { cvt_nz(libc::posix_spawnattr_setflags(attrs.0.as_mut_ptr(), flags as _))?; // Make sure we synchronize access to the global `environ` resource - let _env_lock = sys::os::env_lock(); + let _env_lock = sys::os::env_read_lock(); let envp = envp.map(|c| c.as_ptr()).unwrap_or_else(|| *sys::os::environ() as *const _); cvt_nz(libc::posix_spawnp( &mut p.pid, |
