Skip to content

Commit

Permalink
Auto merge of #2035 - semarie:openbsd-safesignal, r=JohnTitor
Browse files Browse the repository at this point in the history
openbsd: make WIFCONTINUED() safe

it seems it was a missed part of #1891

Found it because rustc -nightly started to use `libc::WIFCONTINUED()` recently in a safe context and the build fail to build on OpenBSD.

Fixes #2001
  • Loading branch information
bors committed Jan 18, 2021
2 parents bb8fe9a + cf0793a commit 7f11cdb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1402,11 +1402,7 @@ fn _ALIGN(p: usize) -> usize {
}

f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status & 0o177777 == 0o177777
}

pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
(cmsg as *mut ::c_uchar)
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
}
Expand Down Expand Up @@ -1451,6 +1447,10 @@ safe_f! {
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
(status & 0xff) == 0o177
}

pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
(status & 0o177777) == 0o177777
}
}

extern "C" {
Expand Down

0 comments on commit 7f11cdb

Please sign in to comment.