Skip to content

Commit 9100c0f

Browse files
committed
Auto merge of rust-lang#750 - agrover:fix-devt-minor, r=alexcrichton
Fix dev_t minor() bitmasking on Linux This code appears to be modeled on the macros in glibc bits/sysmacros.h (since Glibc 2.26). Fix the masking of bits for minor() to match that implementation, which also corresponds with the explanatory comment in that file.
2 parents c17711e + b5bb3b4 commit 9100c0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unix/notbsd/linux/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ f! {
962962

963963
pub fn minor(dev: ::dev_t) -> ::c_uint {
964964
let mut minor = 0;
965-
minor |= (dev & 0xfffff00000000000) >> 0;
965+
minor |= (dev & 0x00000000000000ff) >> 0;
966966
minor |= (dev & 0x00000ffffff00000) >> 12;
967967
minor as ::c_uint
968968
}

0 commit comments

Comments
 (0)