summaryrefslogtreecommitdiff
path: root/src/sys/timerfd.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-09-19 08:29:31 -0600
committerGitHub <noreply@github.com>2021-09-19 08:29:31 -0600
commit515e99bcffcf324d03128649f3ee0ca14d67b5b1 (patch)
tree654a84d639d1feca971396f958f7589fc1fb81bf /src/sys/timerfd.rs
parentf0d6d0406d8e763619aecac062d1d2b56ca6e7b2 (diff)
parenta09b1c8ac643d448db479a108ac6726307075453 (diff)
downloadnix-515e99bcffcf324d03128649f3ee0ca14d67b5b1.zip
Merge pull request #1529 from asomers/clippy-9-2021
Clippy cleanup
Diffstat (limited to 'src/sys/timerfd.rs')
-rw-r--r--src/sys/timerfd.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/sys/timerfd.rs b/src/sys/timerfd.rs
index 5d87b7c2..705a3c4d 100644
--- a/src/sys/timerfd.rs
+++ b/src/sys/timerfd.rs
@@ -257,14 +257,9 @@ impl TimerFd {
///
/// Note: If the alarm is unset, then you will wait forever.
pub fn wait(&self) -> Result<()> {
- loop {
- if let Err(e) = read(self.fd, &mut [0u8; 8]) {
- match e {
- Errno::EINTR => continue,
- _ => return Err(e),
- }
- } else {
- break;
+ while let Err(e) = read(self.fd, &mut [0u8; 8]) {
+ if e != Errno::EINTR {
+ return Err(e)
}
}