diff --git a/CHANGELOG.md b/CHANGELOG.md index 197ceee2cd..9c53caf977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ([#741](https://github.com/nix-rust/nix/pull/741)) - Added more standard trait implementations for various types. ([#814](https://github.com/nix-rust/nix/pull/814)) +- Remove return type from `pause`. + ([#829](https://github.com/nix-rust/nix/pull/829)) ### Changed - Use native `pipe2` on all BSD targets. Users should notice no difference. diff --git a/src/unistd.rs b/src/unistd.rs index 56390d90fa..0f47a7fc35 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -1316,14 +1316,12 @@ pub fn initgroups(user: &CStr, group: Gid) -> Result<()> { Errno::result(res).map(|_| ()) } -/// Suspend the thread until a signal is received +/// Suspend the thread until a signal is received. /// -/// See also [pause(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html) +/// See also [pause(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html). #[inline] -pub fn pause() -> Result<()> { - let res = unsafe { libc::pause() }; - - Errno::result(res).map(drop) +pub fn pause() { + unsafe { libc::pause() }; } /// Suspend execution for an interval of time diff --git a/test/sys/test_wait.rs b/test/sys/test_wait.rs index 9992607cab..14f4530a5c 100644 --- a/test/sys/test_wait.rs +++ b/test/sys/test_wait.rs @@ -12,7 +12,7 @@ fn test_wait_signal() { // Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe. match fork().expect("Error: Fork Failed") { - Child => pause().unwrap_or_else(|_| unsafe { _exit(123) }), + Child => pause(), Parent { child } => { kill(child, Some(SIGKILL)).expect("Error: Kill Failed"); assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, SIGKILL, false)));