From 8eddfed681d5145709ecf5b1a9907b30e4552f5e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 17 May 2021 11:01:00 +0100 Subject: [PATCH] timedread: Retry on EINTR from poll In test failures which occurred before I introeduced packetframe: Fuse: Do not persist EINTR or EWOULDBLOCK I think I observed poll() returning EINTR. Better to handle that here even if the next layer up might do so. Signed-off-by: Ian Jackson --- src/timedread.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/timedread.rs b/src/timedread.rs index 1a6c6874..b4278232 100644 --- a/src/timedread.rs +++ b/src/timedread.rs @@ -97,7 +97,13 @@ impl Read for TimedFdReader { } else { None }; - self.poll.poll(&mut self.events, timeout)?; + loop { + match self.poll.poll(&mut self.events, timeout) { + Err(e) if e.kind() == ErrorKind::Interrupted => continue, + Err(e) => throw!(e), + Ok(()) => break, + } + } if self.events.is_empty() { throw!(io::ErrorKind::TimedOut) } } } -- 2.30.2