Skip to content

Commit

Permalink
Use pause(2) in test_wait_signal
Browse files Browse the repository at this point in the history
Replace a busy loop with a call to `pause(2)`.
  • Loading branch information
kamalmarhubi committed Mar 30, 2016
1 parent 12facb0 commit 507dfaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sys/test_wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use libc::exit;
#[test]
fn test_wait_signal() {
match fork() {
Ok(Child) => loop { /* Wait for signal */ },
Ok(Child) => pause().unwrap_or(()),
Ok(Parent(child_pid)) => {
kill(child_pid, SIGKILL).ok().expect("Error: Kill Failed");
assert_eq!(waitpid(child_pid, None), Ok(WaitStatus::Signaled(child_pid, SIGKILL, false)));
Expand Down

0 comments on commit 507dfaf

Please sign in to comment.