From a0ada39f1badbcd92b6e8b01d67bd0d39067db54 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 29 Aug 2019 19:31:56 -0600 Subject: [PATCH] rtl8168d: Open irq file with O_NONBLOCK --- rtl8168d/src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rtl8168d/src/main.rs b/rtl8168d/src/main.rs index 19908dba1b..e2cb2e51c1 100644 --- a/rtl8168d/src/main.rs +++ b/rtl8168d/src/main.rs @@ -33,10 +33,17 @@ fn main() { // Daemonize if unsafe { syscall::clone(0).unwrap() } == 0 { - let socket_fd = syscall::open(":network", syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK).expect("rtl8168d: failed to create network scheme"); + let socket_fd = syscall::open( + ":network", + syscall::O_RDWR | syscall::O_CREAT | syscall::O_NONBLOCK + ).expect("rtl8168d: failed to create network scheme"); let socket = Arc::new(RefCell::new(unsafe { File::from_raw_fd(socket_fd as RawFd) })); - let mut irq_file = File::open(format!("irq:{}", irq)).expect("rtl8168d: failed to open IRQ file"); + let irq_fd = syscall::open( + format!("irq:{}", irq), + syscall::O_RDWR | syscall::O_NONBLOCK + ).expect("rtl8168d: failed to open IRQ file"); + let mut irq_file = unsafe { File::from_raw_fd(irq_fd as RawFd) }; let address = unsafe { syscall::physmap(bar, 256, PHYSMAP_WRITE | PHYSMAP_NO_CACHE).expect("rtl8168d: failed to map address") }; {