Skip to content

Commit e67a3da

Browse files
committed
port_getn can fail wirh errno EINTR when timer expires. But it's valid option.
1 parent 74ca676 commit e67a3da

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/sys/unix/selector/evport.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ impl Selector {
6565
// assigned.
6666
unsafe { events.set_len(nget as usize) };
6767
})
68+
.or_else(|err| {
69+
// The time interval can expire but still it's valid case.
70+
if err.raw_os_error() == Some(libc::ETIME) {
71+
Ok(())
72+
} else {
73+
Err(err)
74+
}
75+
})
6876
}
6977

7078
pub fn register(&self, fd: RawFd, token: Token, interests: Interests) -> io::Result<()> {

0 commit comments

Comments
 (0)