From c9be6e47492ad58c214aaf4cf0f967fd0221fc36 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 2 Mar 2024 22:00:18 +0100 Subject: [PATCH] merge syscall blocks together - increase the readability --- src/sys/unix/mod.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/sys/unix/mod.rs b/src/sys/unix/mod.rs index 8d93c52df..e391847bd 100644 --- a/src/sys/unix/mod.rs +++ b/src/sys/unix/mod.rs @@ -5,18 +5,11 @@ 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 { - Ok(res) - } }}; }