Skip to content

Commit

Permalink
Restore handler in test_old_sigaction_flags()
Browse files Browse the repository at this point in the history
Multiple tests run within the same process in an indeterminate order.
Restore the signal handler at the end of the test so other tests aren't
affected.
  • Loading branch information
Chris Pick committed Nov 14, 2023
1 parent b9ff39e commit 6616ba5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/sys/test_signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ fn test_old_sigaction_flags() {
);
let oact = unsafe { sigaction(SIGINT, &act) }.unwrap();
let _flags = oact.flags();
let oact = unsafe { sigaction(SIGINT, &act) }.unwrap();
let _flags = oact.flags();
let _flags = unsafe { sigaction(SIGINT, &act) }.unwrap().flags();

// restore original
unsafe { sigaction(SIGINT, &oact) }.unwrap();
}

#[test]
Expand Down

0 comments on commit 6616ba5

Please sign in to comment.