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:
Andy Grover 2017-08-30 14:49:19 -07:00
parent c17711e5fb
commit b5bb3b4a1d
1 changed files with 1 additions and 1 deletions

View File

@ -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
}