Skip to content

Commit 507dfaf

Browse files
committed
Use pause(2) in test_wait_signal
Replace a busy loop with a call to `pause(2)`.
1 parent 12facb0 commit 507dfaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/sys/test_wait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use libc::exit;
77
#[test]
88
fn test_wait_signal() {
99
match fork() {
10-
Ok(Child) => loop { /* Wait for signal */ },
10+
Ok(Child) => pause().unwrap_or(()),
1111
Ok(Parent(child_pid)) => {
1212
kill(child_pid, SIGKILL).ok().expect("Error: Kill Failed");
1313
assert_eq!(waitpid(child_pid, None), Ok(WaitStatus::Signaled(child_pid, SIGKILL, false)));

0 commit comments

Comments
 (0)