Skip to content

Commit 4cd267a

Browse files
authored
Fix the display of the errnos (#40)
Turns out that we were getting a negative error number, but all the errnos are positive! This change fixes that.
1 parent f13c6b0 commit 4cd267a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sys.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize};
1919
/// negative, and the result of the function as-is otherwise.
2020
fn check_err(num: libc::c_long) -> Result<libc::c_long> {
2121
if num < 0 {
22-
match Errno::from_i32(num.try_into()?) {
22+
match Errno::from_i32(-num.try_into()?) {
2323
Errno::UnknownErrno => {
2424
bail!("unknown errno: {}", num);
2525
}

0 commit comments

Comments
 (0)