Skip to content

Commit

Permalink
Revert "Update src/sys/unix/mod.rs"
Browse files Browse the repository at this point in the history
This reverts commit a8a5c5b.
  • Loading branch information
stlankes committed Jul 8, 2024
1 parent a8a5c5b commit 7f7bfbb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
macro_rules! syscall {
($fn: ident ( $($arg: expr),* $(,)* ) ) => {{
let res = unsafe { libc::$fn($($arg, )*) };
#[cfg(target_os = "hermit")]
if res < 0 {
Err(std::io::Error::last_os_error())
} else {
Ok(res)
}
#[cfg(unix)]
if res == -1 {
Err(std::io::Error::last_os_error())
} else {
Expand Down

0 comments on commit 7f7bfbb

Please sign in to comment.