summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-24 02:29:50 +0000
committerbors <bors@rust-lang.org>2022-01-24 02:29:50 +0000
commit78e76aa33fd4019b2663ecd557b308fd13b3c824 (patch)
treef054eefacf2bfbfd5093fc507c51496d61e38652
parent4d0347364e82a96f6377b068918fc17bcbe0b57d (diff)
parenta894685dbe9d858364987b734aa671cb538232f3 (diff)
downloadrust-libc-78e76aa33fd4019b2663ecd557b308fd13b3c824.tar.gz
Auto merge of #2644 - rtzoeller:dfly_cmsg_align_again, r=Amanieu
Fix _CMSG_ALIGN on DragonFly The attempted fix in #2610 originally had `7` hard coded, but it was suggested I replace this with a size_of call. Unfortunately the suggestion omitted a subtraction from the size_of call, and I didn't catch it. Tested by running the failing `nix` tests on DragonFly (and didn't change the code again after running the tests).
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index e739decb93..abe0440605 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1348,7 +1348,7 @@ pub const MINCORE_SUPER: ::c_int = 0x20;
const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
- (n + ::mem::size_of::<::c_long>()) & !::mem::size_of::<::c_long>()
+ (n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
}
}