From: David Herrmann Date: Tue, 2 Sep 2014 12:17:59 +0000 (+0200) Subject: terminal: discard async read() errors for evdev X-Git-Tag: v217~606 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=98b7fe2ad4055a7978edc28caaadd5a0a9bd97a9;ds=sidebyside terminal: discard async read() errors for evdev 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. --- diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c index c93ede8dc..9e2dc811e 100644 --- a/src/libsystemd-terminal/idev-evdev.c +++ b/src/libsystemd-terminal/idev-evdev.c @@ -217,7 +217,7 @@ static int idev_evdev_io(idev_evdev *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) {