File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
.vscode/cspell.dictionaries Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ multicall
102102nmerge
103103noatime
104104nocache
105+ NOCLDSTOP
105106nocreat
106107noctty
107108noerror
@@ -129,6 +130,7 @@ primality
129130pselect
130131pseudoprime
131132pseudoprimes
133+ pthread
132134quantiles
133135readonly
134136reparse
@@ -144,10 +146,15 @@ setmask
144146setlocale
145147shortcode
146148shortcodes
149+ sigaction
150+ sigaddset
147151siginfo
148152sigmask
149153sigusr
150154sigprocmask
155+ SIGRTMAX
156+ SIGRTMIN
157+ sigset
151158strcasecmp
152159subcommand
153160subexpression
Original file line number Diff line number Diff line change @@ -285,14 +285,17 @@ fn preserve_signal_info(signal: libc::c_int) -> libc::c_int {
285285}
286286
287287#[ cfg( unix) ]
288- #[ allow( clippy:: reversed_empty_ranges) ]
289288fn block_ignored_signals ( ) -> nix:: Result < ( ) > {
290- let mut set = SigSet :: empty ( ) ;
291- let rt_signals = if cfg ! ( target_os = "linux" ) {
289+ # [ cfg ( target_os = "linux" ) ]
290+ fn rt_signals ( ) -> impl Iterator < Item = i32 > {
292291 libc:: SIGRTMIN ( ) ..=libc:: SIGRTMAX ( )
293- } else {
294- 0 ..=( -1 )
295- } ;
292+ }
293+ #[ cfg( not( target_os = "linux" ) ) ]
294+ fn rt_signals ( ) -> impl Iterator < Item = i32 > {
295+ std:: iter:: empty ( )
296+ }
297+
298+ let mut set = SigSet :: empty ( ) ;
296299 for s in Signal :: iterator ( )
297300 . filter_map ( |s| {
298301 if matches ! ( s, Signal :: SIGSTOP | Signal :: SIGKILL | Signal :: SIGTERM ) {
@@ -301,12 +304,12 @@ fn block_ignored_signals() -> nix::Result<()> {
301304 Some ( s as i32 )
302305 }
303306 } )
304- . chain ( rt_signals)
307+ . chain ( rt_signals ( ) )
305308 {
306309 if is_ignored ( s) ? {
307310 // We use raw libc bindings because [`nix`] does not support RT signals.
308311 // SAFETY: SigSet is repr(transparent) over sigset_t.
309- unsafe { libc:: sigaddset ( ( & mut set as * mut SigSet ) . cast ( ) , s) } ;
312+ unsafe { libc:: sigaddset ( ( & raw mut set ) . cast ( ) , s) } ;
310313 }
311314 }
312315 pthread_sigmask ( SigmaskHow :: SIG_BLOCK , Some ( & set) , None )
Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ ringbuffer = []
164164safe-traversal = [" libc" ]
165165selinux = [" dep:selinux" ]
166166smack = [" xattr" ]
167- signals = []
167+ signals = [" libc " ]
168168sum = [
169169 " digest" ,
170170 " hex" ,
You can’t perform that action at this time.
0 commit comments