From 2f90a065337698c5b176f2cd97ca92620823ba19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20L=C3=B3pez?= Date: Mon, 13 Jan 2025 21:03:05 +0100 Subject: [PATCH] core/io/unix: replace O_NONBLOCK flag from libc with equivalent from rustix --- core/io/unix.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/io/unix.rs b/core/io/unix.rs index 035c9f29d..c021c4566 100644 --- a/core/io/unix.rs +++ b/core/io/unix.rs @@ -7,8 +7,7 @@ use log::{debug, trace}; use polling::{Event, Events, Poller}; use rustix::{ fd::{AsFd, AsRawFd}, - fs, - fs::{FlockOperation, OpenOptionsExt}, + fs::{self, FlockOperation, OFlags, OpenOptionsExt}, io::Errno, }; use std::cell::RefCell; @@ -38,7 +37,7 @@ impl IO for UnixIO { trace!("open_file(path = {})", path); let file = std::fs::File::options() .read(true) - .custom_flags(libc::O_NONBLOCK) + .custom_flags(OFlags::NONBLOCK.bits() as i32) .write(true) .create(matches!(flags, OpenFlags::Create)) .open(path)?;