diff options
author | Antti Keränen <detegr@gmail.com> | 2018-03-02 20:09:37 +0200 |
---|---|---|
committer | Antti Keränen <detegr@gmail.com> | 2018-03-02 22:22:04 +0200 |
commit | 44192051dcc60a9ebd9803ed085bbdd9d0b53d8e (patch) | |
tree | 4cd2b8e67c5602910f7f79941c27e0a9c3f5228f /src/sys | |
parent | 2b9c67cca5c6113a9b8162ca7abef33269439997 (diff) | |
download | nix-44192051dcc60a9ebd9803ed085bbdd9d0b53d8e.zip |
Change SigAction::flags to use from_bits_truncated
On Linux, if the signal trampoline code is in the C library, sigaction
sets the SA_RESTORER flag (0x04000000) in the sa_flags field of old
sigaction (see sigreturn(2)).
This is not intended for application use and is missing from SaFlags,
therefore from_bits fails and unwrapping panics the user program.
This fix just drops the bits that are not defined in SaFlags.
Diffstat (limited to 'src/sys')
-rw-r--r-- | src/sys/signal.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sys/signal.rs b/src/sys/signal.rs index 10798ba1..875f5de6 100644 --- a/src/sys/signal.rs +++ b/src/sys/signal.rs @@ -389,7 +389,7 @@ impl SigAction { } pub fn flags(&self) -> SaFlags { - SaFlags::from_bits(self.sigaction.sa_flags).unwrap() + SaFlags::from_bits_truncate(self.sigaction.sa_flags) } pub fn mask(&self) -> SigSet { |