Skip to content

Commit 7f11cdb

Browse files
committed
Auto merge of #2035 - semarie:openbsd-safesignal, r=JohnTitor
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
2 parents bb8fe9a + cf0793a commit 7f11cdb

File tree

1 file changed

+5
-5
lines changed
  • src/unix/bsd/netbsdlike/openbsd

1 file changed

+5
-5
lines changed

src/unix/bsd/netbsdlike/openbsd/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1402,11 +1402,7 @@ fn _ALIGN(p: usize) -> usize {
14021402
}
14031403

14041404
f! {
1405-
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
1406-
status & 0o177777 == 0o177777
1407-
}
1408-
1409-
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
1405+
pub fn CMSG_DATA(cmsg: *const ::cmsghdr) -> *mut ::c_uchar {
14101406
(cmsg as *mut ::c_uchar)
14111407
.offset(_ALIGN(::mem::size_of::<::cmsghdr>()) as isize)
14121408
}
@@ -1451,6 +1447,10 @@ safe_f! {
14511447
pub {const} fn WIFSTOPPED(status: ::c_int) -> bool {
14521448
(status & 0xff) == 0o177
14531449
}
1450+
1451+
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
1452+
(status & 0o177777) == 0o177777
1453+
}
14541454
}
14551455

14561456
extern "C" {

0 commit comments

Comments
 (0)