Skip to content

Commit

Permalink
openbsd: make WIFCONTINUED() safe
Browse files Browse the repository at this point in the history
  • Loading branch information
semarie committed Jan 16, 2021
1 parent bb8fe9a commit cf0793a
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 cf0793a

Please sign in to comment.