Print the raw errno if it is not an expected value
This commit is contained in:
parent
3c11d589f4
commit
70d3bf690c
@ -194,7 +194,10 @@ impl Errno {
|
||||
|
||||
impl From<u32> for Errno {
|
||||
fn from(raw_errno: u32) -> Self {
|
||||
assert!(ERRNO_MIN <= raw_errno && raw_errno <= ERRNO_MAX);
|
||||
if raw_errno < ERRNO_MIN || raw_errno > ERRNO_MAX {
|
||||
error!("unexpected raw errno: {}", raw_errno);
|
||||
panic!();
|
||||
}
|
||||
unsafe { core::mem::transmute(raw_errno as u8) }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user