mirror of https://github.com/smol-rs/polling
chore: Hermit fixes
Check 'x < 0' instead of 'x == -1' Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
parent
2934db21d6
commit
6f1fdb5fdf
|
@ -474,7 +474,7 @@ mod syscall {
|
|||
pub(super) fn eventfd(count: u64, _flags: EventfdFlags) -> io::Result<OwnedFd> {
|
||||
let fd = unsafe { hermit_abi::eventfd(count, 0) };
|
||||
|
||||
if fd == -1 {
|
||||
if fd < 0 {
|
||||
Err(io::Error::from_raw_os_error(unsafe {
|
||||
hermit_abi::get_errno()
|
||||
}))
|
||||
|
@ -612,7 +612,7 @@ mod syscall {
|
|||
/// Convert a number to an actual result.
|
||||
#[inline]
|
||||
fn cvt(len: isize) -> io::Result<usize> {
|
||||
if len == -1 {
|
||||
if len < 0 {
|
||||
Err(io::Error::from_raw_os_error(unsafe {
|
||||
hermit_abi::get_errno()
|
||||
}))
|
||||
|
|
Loading…
Reference in New Issue