Skip to content

Commit

Permalink
port_getn can fail wirh errno EINTR when timer expires. But it's vali…
Browse files Browse the repository at this point in the history
…d option.
  • Loading branch information
psumbera committed Nov 20, 2019
1 parent 74ca676 commit e67a3da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sys/unix/selector/evport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ impl Selector {
// assigned.
unsafe { events.set_len(nget as usize) };
})
.or_else(|err| {
// The time interval can expire but still it's valid case.
if err.raw_os_error() == Some(libc::ETIME) {
Ok(())
} else {
Err(err)
}
})
}

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

0 comments on commit e67a3da

Please sign in to comment.