summary refs log tree commit diff
path: root/sys_util
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2018-04-18 18:18:00 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-19 01:13:09 -0700
commitd14c41a81fa71fba2e868fbc86c1b28c05186001 (patch)
treed1c9a537fa0b8da7bd61fd58ef27eb193d727b8c /sys_util
parent7a7268faf0a43c79b6a4520f5c2f35c3e0233932 (diff)
downloadcrosvm-d14c41a81fa71fba2e868fbc86c1b28c05186001.tar
crosvm-d14c41a81fa71fba2e868fbc86c1b28c05186001.tar.gz
crosvm-d14c41a81fa71fba2e868fbc86c1b28c05186001.tar.bz2
crosvm-d14c41a81fa71fba2e868fbc86c1b28c05186001.tar.lz
crosvm-d14c41a81fa71fba2e868fbc86c1b28c05186001.tar.xz
crosvm-d14c41a81fa71fba2e868fbc86c1b28c05186001.tar.zst
crosvm-d14c41a81fa71fba2e868fbc86c1b28c05186001.zip
sys_util: handle EINTR return from epoll_wait
The PollContext::wait returns Error on EINTR, which often happens during
suspend/resume cycles. Because this Error is transient, this should be
handled internally with a retry until a fatal error is encountered.

BUG=chromium:834558
TEST=run crosvm, suspend, resume, observe crosvm still running

Change-Id: I75469e261ddf28f025a3b3b93612538ccf1230b9
Reviewed-on: https://chromium-review.googlesource.com/1018527
Commit-Ready: Zach Reizner <zachr@chromium.org>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'sys_util')
-rw-r--r--sys_util/src/poll.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys_util/src/poll.rs b/sys_util/src/poll.rs
index 2a4eb63..32703d2 100644
--- a/sys_util/src/poll.rs
+++ b/sys_util/src/poll.rs
@@ -418,10 +418,10 @@ impl<T: PollToken> PollContext<T> {
             // Safe because we give an epoll context and a properly sized epoll_events array
             // pointer, which we trust the kernel to fill in properly.
             unsafe {
-                epoll_wait(self.epoll_ctx.as_raw_fd(),
-                           &mut epoll_events[0],
-                           max_events,
-                           timeout_millis)
+                handle_eintr_errno!(epoll_wait(self.epoll_ctx.as_raw_fd(),
+                                               &mut epoll_events[0],
+                                               max_events,
+                                               timeout_millis))
             }
         };
         if ret < 0 {