diff options
Diffstat (limited to 'library/std/src/sys/hermit/mod.rs')
-rw-r--r-- | library/std/src/sys/hermit/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/library/std/src/sys/hermit/mod.rs b/library/std/src/sys/hermit/mod.rs index c7cb84667..abd7eb353 100644 --- a/library/std/src/sys/hermit/mod.rs +++ b/library/std/src/sys/hermit/mod.rs @@ -101,7 +101,6 @@ pub extern "C" fn __rust_abort() { // SAFETY: must be called only once during runtime initialization. // NOTE: this is not guaranteed to run, for example when Rust code is called externally. pub unsafe fn init(argc: isize, argv: *const *const u8, _sigpipe: u8) { - let _ = net::init(); args::init(argc, argv); } @@ -130,6 +129,11 @@ pub unsafe extern "C" fn runtime_entry( abi::exit(result); } +#[inline] +pub(crate) fn is_interrupted(errno: i32) -> bool { + errno == abi::errno::EINTR +} + pub fn decode_error_kind(errno: i32) -> ErrorKind { match errno { abi::errno::EACCES => ErrorKind::PermissionDenied, @@ -196,7 +200,7 @@ where { loop { match cvt(f()) { - Err(ref e) if e.kind() == ErrorKind::Interrupted => {} + Err(ref e) if e.is_interrupted() => {} other => return other, } } |