Skip to content

Commit 5f321db

Browse files
committed
Merge #836
836: Remove return value from `pause` r=asomers a=Thomasdezeeuw Follow up on #829, since that repo is now unknown to GitHub.
2 parents 2478f0f + 992c293 commit 5f321db

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
9494
- Both `ip_mreq` and `ipv6_mreq` have been replaced with `IpMembershipRequest` and
9595
`Ipv6MembershipRequest`.
9696
([#814](https://github.com/nix-rust/nix/pull/814))
97-
97+
- Removed return type from `pause`.
98+
([#829](https://github.com/nix-rust/nix/pull/829))
9899

99100
### Fixed
100101
- Fix compilation and tests for OpenBSD targets

src/unistd.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -1316,14 +1316,12 @@ pub fn initgroups(user: &CStr, group: Gid) -> Result<()> {
13161316
Errno::result(res).map(|_| ())
13171317
}
13181318

1319-
/// Suspend the thread until a signal is received
1319+
/// Suspend the thread until a signal is received.
13201320
///
1321-
/// See also [pause(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html)
1321+
/// See also [pause(2)](http://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html).
13221322
#[inline]
1323-
pub fn pause() -> Result<()> {
1324-
let res = unsafe { libc::pause() };
1325-
1326-
Errno::result(res).map(drop)
1323+
pub fn pause() {
1324+
unsafe { libc::pause() };
13271325
}
13281326

13291327
/// Suspend execution for an interval of time

test/sys/test_wait.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ fn test_wait_signal() {
1212

1313
// Safe: The child only calls `pause` and/or `_exit`, which are async-signal-safe.
1414
match fork().expect("Error: Fork Failed") {
15-
Child => pause().unwrap_or_else(|_| unsafe { _exit(123) }),
15+
Child => {
16+
pause();
17+
unsafe { _exit(123) }
18+
},
1619
Parent { child } => {
1720
kill(child, Some(SIGKILL)).expect("Error: Kill Failed");
1821
assert_eq!(waitpid(child, None), Ok(WaitStatus::Signaled(child, SIGKILL, false)));

0 commit comments

Comments
 (0)