diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-02-20 21:13:56 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-02-20 21:15:52 +0000 |
commit | 3a2dec17459dea56331430c8481646d538278518 (patch) | |
tree | a1504c38e583375e21c0b6e149e731acb73c6ae9 | |
parent | 33ee0c3b21ea279e08d0863fcb2e874f0974b00e (diff) |
sna: Repeat udev_monitor_get_device() if interrupted
In case udev_monitor_get_device() itself does not handle being
interrupted, go around the loop again. Daniel Vetter discovered this
interesting quirk during igt testing of kms_leases.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_driver.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index bb0c5fcf..754b2d4f 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -802,9 +802,14 @@ sna_handle_uevents(int fd, void *closure) struct udev_device *dev; dev_t devnum; + errno = 0; dev = udev_monitor_receive_device(sna->uevent_monitor); - if (dev == NULL) + if (dev == NULL) { + if (errno == EINTR || errno == EAGAIN) + continue; + break; + } devnum = udev_device_get_devnum(dev); if (memcmp(&s.st_rdev, &devnum, sizeof(dev_t)) == 0) { |