]> git.proxmox.com Git - proxmox-fuse.git/commitdiff
ignore interrupts in reactor
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 21 Mar 2024 11:32:06 +0000 (12:32 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 21 Mar 2024 11:32:21 +0000 (12:32 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/fuse_fd.rs

index ce57e2de564fb5f3361d3a8b748d6eb404ed9998..e3411826ceb2c606b65c36b8f48751a474dae0c4 100644 (file)
@@ -275,11 +275,17 @@ impl Epoll {
 
     /// `epoll_wait` wrapper.
     fn wait(&self, events: &mut [libc::epoll_event]) -> io::Result<usize> {
-        let rc = unsafe { libc::epoll_wait(self.epfd, &mut events[0], events.len() as i32, -1) };
-        if rc < 0 {
-            Err(io::Error::last_os_error())
-        } else {
-            Ok(rc as usize)
+        loop {
+            let rc =
+                unsafe { libc::epoll_wait(self.epfd, &mut events[0], events.len() as i32, -1) };
+            if rc < 0 {
+                let err = io::Error::last_os_error();
+                if err.kind() == io::ErrorKind::Interrupted {
+                    continue;
+                }
+                return Err(io::Error::last_os_error());
+            }
+            return Ok(rc as usize);
         }
     }
 }