From 7ee3018db9eb97390ac68bdb424cad08ceba189f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 17 May 2021 14:48:35 +0100 Subject: [PATCH] timedfd: Add note re nonblock open-file This is why we must swap both ends of a mgmtchannel at once. Signed-off-by: Ian Jackson --- src/timedfd.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/timedfd.rs b/src/timedfd.rs index 91eed394..cffd5891 100644 --- a/src/timedfd.rs +++ b/src/timedfd.rs @@ -61,12 +61,17 @@ impl nix::Error { } impl TimedFd where RW: TimedFdReadWrite { + /// Takes ownership of the fd + /// + /// Will change the fd's open-file to nonblocking. #[throws(io::Error)] pub fn new(fd: F) -> TimedFd where F: IntoRawFd { Self::from_fd( Fd::from_raw_fd( fd.into_raw_fd() ))? } /// Takes ownership of the fd + /// + /// Will change the fd's open-file to nonblocking. #[throws(io::Error)] fn from_fd(fd: Fd) -> Self { fcntl(fd.as_raw_fd(), FcntlArg::F_SETFL(OFlag::O_NONBLOCK)) -- 2.30.2