File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -487,16 +487,16 @@ impl Profiler {
487487 let handler = signal:: SigHandler :: SigAction ( perf_signal_handler) ;
488488 // SA_RESTART will only restart a syscall when it's safe to do so,
489489 // e.g. when it's a blocking read(2) or write(2). See man 7 signal.
490- let mut flags = signal:: SaFlags :: SA_SIGINFO | signal:: SaFlags :: SA_RESTART ;
490+ let flags = signal:: SaFlags :: SA_SIGINFO | signal:: SaFlags :: SA_RESTART ;
491491 #[ cfg( feature = "frame-pointer" ) ]
492- {
493- if self . on_stack {
494- // SA_ONSTACK will deliver the signal on an alternate stack. This is crucial
495- // to prevent a stack overflow if the signal arrives at a thread with
496- // a small stack, which is common when use pprof-rs in Go runtimes.
497- flags |= signal :: SaFlags :: SA_ONSTACK ;
498- }
499- }
492+ let flags = if self . on_stack {
493+ // SA_ONSTACK will deliver the signal on an alternate stack. This is crucial
494+ // to prevent a stack overflow if the signal arrives at a thread with
495+ // a small stack, which is common when use pprof-rs in Go runtimes.
496+ flags | signal :: SaFlags :: SA_ONSTACK
497+ } else {
498+ flags
499+ } ;
500500 let sigaction = signal:: SigAction :: new ( handler, flags, signal:: SigSet :: empty ( ) ) ;
501501 let old_action = unsafe { signal:: sigaction ( signal:: SIGPROF , & sigaction) } ?;
502502 self . old_sigaction = Some ( old_action) ;
You can’t perform that action at this time.
0 commit comments