Auto merge of #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.
This commit is contained in:
commit
9100c0fde9
@ -962,7 +962,7 @@ f! {
|
||||
|
||||
pub fn minor(dev: ::dev_t) -> ::c_uint {
|
||||
let mut minor = 0;
|
||||
minor |= (dev & 0xfffff00000000000) >> 0;
|
||||
minor |= (dev & 0x00000000000000ff) >> 0;
|
||||
minor |= (dev & 0x00000ffffff00000) >> 12;
|
||||
minor as ::c_uint
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user