We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a070ca7 commit 2b3de95Copy full SHA for 2b3de95
src/sys.rs
@@ -5,21 +5,25 @@ use libc as sys;
5
#[macro_export]
6
macro_rules! syscall {
7
($ret:expr) => {{
8
- if $ret != 0 {
9
- Err(::std::io::Error::from_raw_os_error($ret))
+ let result = $ret;
+
10
+ if result != 0 {
11
+ Err(::std::io::Error::from_raw_os_error(result))
12
} else {
- Ok($ret)
13
+ Ok(result)
14
}
15
}};
16
17
18
19
macro_rules! syscall_los {
20
- if $ret == (u32::MAX as _) {
- Err(io::Error::last_os_error())
21
22
23
+ if result == -1 {
24
+ Err(::std::io::Error::last_os_error())
25
26
27
28
29
0 commit comments