about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorRain <rain@sunshowers.io>2022-09-22 22:48:14 -0700
committerRain <rain@sunshowers.io>2022-10-20 14:53:38 -0700
commita52c79e859142c1cd5c0c5bdb73f16b754e1b98f (patch)
treeac8aea871f084c1521a9ee86c6adc3cf19313967 /src/test
parent542febd2d383b5082277c7d165b098c0a3b513f6 (diff)
downloadrust-a52c79e859142c1cd5c0c5bdb73f16b754e1b98f.tar.gz
rust-a52c79e859142c1cd5c0c5bdb73f16b754e1b98f.zip
Change process spawning to inherit the parent's signal mask by default
Previously, the signal mask is always reset when a child process is
started. This breaks tools like `nohup` which expect `SIGHUP` to be
blocked.

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.rs6
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);
+        };
     }
 }