chore: Hermit fixes

Check 'x < 0' instead of 'x == -1'

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley 2024-03-11 18:11:24 -07:00
parent 2934db21d6
commit 6f1fdb5fdf
No known key found for this signature in database
GPG Key ID: 2FE69973CFD64832
1 changed files with 2 additions and 2 deletions

View File

@ -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()
}))