]> git.proxmox.com Git - pve-lxc-syscalld.git/commitdiff
set PolledFd to nonblocking
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 30 Oct 2019 13:25:21 +0000 (14:25 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 30 Oct 2019 13:25:21 +0000 (14:25 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/reactor.rs

index c5d5110f3246e531baad1d29f6418cb8e87b5b0a..478c0cbb96cd726223e53f50cc8742a5a3c45d04 100644 (file)
@@ -6,6 +6,7 @@ use std::task::{Context, Poll, Waker};
 use std::thread::JoinHandle;
 
 use crate::epoll::{Epoll, EpollEvent, EPOLLERR, EPOLLET, EPOLLHUP, EPOLLIN, EPOLLOUT};
+use crate::error::io_err_other;
 use crate::tools::Fd;
 
 static START: Once = Once::new();
@@ -160,6 +161,7 @@ impl AsRawFd for PolledFd {
 
 impl PolledFd {
     pub fn new(fd: Fd) -> io::Result<Self> {
+        fd.set_nonblocking(true).map_err(io_err_other)?;
         Self::new_with_reactor(fd, crate::reactor::default())
     }