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 <dev@notgull.net>
  • Loading branch information
notgull committed Mar 13, 2024
1 parent 2934db2 commit 6f1fdb5
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 6f1fdb5

Please sign in to comment.