diff options
| author | bors <bors@rust-lang.org> | 2022-10-21 18:09:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-21 18:09:03 +0000 |
| commit | 57e2c06a8df3187980801962015a88657abd033d (patch) | |
| tree | c74aabe31dd7ce0155ea965ea9ffd71f58ce99e2 /src/test | |
| parent | ba9d01be67a97dd6762935762172e37ee22083ae (diff) | |
| parent | a52c79e859142c1cd5c0c5bdb73f16b754e1b98f (diff) | |
| download | rust-57e2c06a8df3187980801962015a88657abd033d.tar.gz rust-57e2c06a8df3187980801962015a88657abd033d.zip | |
Auto merge of #101077 - sunshowers:signal-mask-inherit, r=sunshowers
Change process spawning to inherit the parent's signal mask by default Previously, the signal mask was always reset when a child process is started. This breaks tools like `nohup` which expect `SIGHUP` to be blocked for all transitive processes. With this change, the default behavior changes to inherit the signal mask. This also changes the signal disposition for `SIGPIPE` to only be changed if the `#[unix_sigpipe]` attribute isn't set.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs b/src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs index e8b4fe7ae52..74fbae0350e 100644 --- a/src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs +++ b/src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs @@ -23,9 +23,11 @@ pub fn assert_sigpipe_handler(expected_handler: SignalHandler) { SignalHandler::Ignore => libc::SIG_IGN, SignalHandler::Default => libc::SIG_DFL, }; - assert_eq!(prev, expected); + assert_eq!(prev, expected, "expected sigpipe value matches actual value"); // Unlikely to matter, but restore the old value anyway - unsafe { libc::signal(libc::SIGPIPE, prev); }; + unsafe { + libc::signal(libc::SIGPIPE, prev); + }; } } |
