From 7f7bfbbc92285424cf132ade7dfb258d90776ea1 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Mon, 8 Jul 2024 12:51:27 +0200 Subject: [PATCH] Revert "Update src/sys/unix/mod.rs" This reverts commit a8a5c5bbcf5590901ff41d76ed1ee60464f33f54. --- src/sys/unix/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sys/unix/mod.rs b/src/sys/unix/mod.rs index a11fc6b28..935ca8439 100644 --- a/src/sys/unix/mod.rs +++ b/src/sys/unix/mod.rs @@ -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 {