Skip to content

Commit 78e76aa

Browse files
committed
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).
2 parents 4d03473 + a894685 commit 78e76aa

File tree

1 file changed

+1
-1
lines changed
  • src/unix/bsd/freebsdlike/dragonfly

1 file changed

+1
-1
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ pub const MINCORE_SUPER: ::c_int = 0x20;
13481348

13491349
const_fn! {
13501350
{const} fn _CMSG_ALIGN(n: usize) -> usize {
1351-
(n + ::mem::size_of::<::c_long>()) & !::mem::size_of::<::c_long>()
1351+
(n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
13521352
}
13531353
}
13541354

0 commit comments

Comments
 (0)