From 507dfaf2976346e95fd735c02ee89f781bcea994 Mon Sep 17 00:00:00 2001 From: Kamal Marhubi Date: Wed, 30 Mar 2016 00:46:29 -0400 Subject: [PATCH] Use pause(2) in test_wait_signal Replace a busy loop with a call to `pause(2)`. --- test/sys/test_wait.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sys/test_wait.rs b/test/sys/test_wait.rs index 01f63dd1b8..7989889be8 100644 --- a/test/sys/test_wait.rs +++ b/test/sys/test_wait.rs @@ -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)));