Skip to content

Commit

Permalink
chore: Hermit fixes
Browse files Browse the repository at this point in the history
Check 'x < 0' instead of 'x == -1'

Signed-off-by: John Nunley <[email protected]>
  • Loading branch information
notgull committed Mar 12, 2024
1 parent 4f4d9a4 commit b98df93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}))
Expand Down Expand Up @@ -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()
}))
Expand Down

0 comments on commit b98df93

Please sign in to comment.