chiark / gitweb /
terminal: discard async read() errors for evdev
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 2 Sep 2014 12:17:59 +0000 (14:17 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Thu, 11 Sep 2014 13:22:16 +0000 (15:22 +0200)
If read() fails on evdev devices, we deal with this in idev_evdev_hup().
It is very likely this is an async revoke, therefore, we must not abort.
Fix our io helper to discard such errors after passing them to
idev_evdev_hup(), so we don't bail out of the event loop.

src/libsystemd-terminal/idev-evdev.c

index c93ede8dc999845ce2d93d921fde7bcb812b1dd1..9e2dc811ef426ab5b927064a8bb6efbc4de554f7 100644 (file)
@@ -217,7 +217,7 @@ static int idev_evdev_io(idev_evdev *evdev) {
 
 error:
         idev_evdev_hup(evdev);
 
 error:
         idev_evdev_hup(evdev);
-        return r;
+        return 0; /* idev_evdev_hup() handles the error so discard it */
 }
 
 static int idev_evdev_event_fn(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
 }
 
 static int idev_evdev_event_fn(sd_event_source *s, int fd, uint32_t revents, void *userdata) {