teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0216-terminal-discard-async-read-errors-for-evdev.patch

Zbigniew Jędrzejewski-Szmek 62fe94
From 98b7fe2ad4055a7978edc28caaadd5a0a9bd97a9 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek 62fe94
From: David Herrmann <dh.herrmann@gmail.com>
Zbigniew Jędrzejewski-Szmek 62fe94
Date: Tue, 2 Sep 2014 14:17:59 +0200
Zbigniew Jędrzejewski-Szmek 62fe94
Subject: [PATCH] terminal: discard async read() errors for evdev
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
If read() fails on evdev devices, we deal with this in idev_evdev_hup().
Zbigniew Jędrzejewski-Szmek 62fe94
It is very likely this is an async revoke, therefore, we must not abort.
Zbigniew Jędrzejewski-Szmek 62fe94
Fix our io helper to discard such errors after passing them to
Zbigniew Jędrzejewski-Szmek 62fe94
idev_evdev_hup(), so we don't bail out of the event loop.
Zbigniew Jędrzejewski-Szmek 62fe94
---
Zbigniew Jędrzejewski-Szmek 62fe94
 src/libsystemd-terminal/idev-evdev.c | 2 +-
Zbigniew Jędrzejewski-Szmek 62fe94
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek 62fe94
Zbigniew Jędrzejewski-Szmek 62fe94
diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c
Zbigniew Jędrzejewski-Szmek 62fe94
index c93ede8dc9..9e2dc811ef 100644
Zbigniew Jędrzejewski-Szmek 62fe94
--- a/src/libsystemd-terminal/idev-evdev.c
Zbigniew Jędrzejewski-Szmek 62fe94
+++ b/src/libsystemd-terminal/idev-evdev.c
Zbigniew Jędrzejewski-Szmek 62fe94
@@ -217,7 +217,7 @@ static int idev_evdev_io(idev_evdev *evdev) {
Zbigniew Jędrzejewski-Szmek 62fe94
 
Zbigniew Jędrzejewski-Szmek 62fe94
 error:
Zbigniew Jędrzejewski-Szmek 62fe94
         idev_evdev_hup(evdev);
Zbigniew Jędrzejewski-Szmek 62fe94
-        return r;
Zbigniew Jędrzejewski-Szmek 62fe94
+        return 0; /* idev_evdev_hup() handles the error so discard it */
Zbigniew Jędrzejewski-Szmek 62fe94
 }
Zbigniew Jędrzejewski-Szmek 62fe94
 
Zbigniew Jędrzejewski-Szmek 62fe94
 static int idev_evdev_event_fn(sd_event_source *s, int fd, uint32_t revents, void *userdata) {