aboutsummaryrefslogtreecommitdiffstats
path: root/evtest-capture.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-04-22 15:38:43 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-04-22 15:39:46 +1000
commit9e91acb83ac28cc81ddfacbcd85751dfec48dee0 (patch)
tree9fb99995eb3302b8e8f2d2f411fae9812688522f /evtest-capture.c
parentb071228996005d26e4e6546e14bfd3f93b907ca6 (diff)
downloadexternal_evtest-9e91acb83ac28cc81ddfacbcd85751dfec48dee0.tar.gz
external_evtest-9e91acb83ac28cc81ddfacbcd85751dfec48dee0.tar.bz2
external_evtest-9e91acb83ac28cc81ddfacbcd85751dfec48dee0.zip
evtest-capture: on EINTR, just continue.
We could break directlly, but maybe the signal handler needs to do funkier things in the future, so just rely on it to set the stop variable accordingly. This patch fixes the crashes experienced on grabbed event devices. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'evtest-capture.c')
-rw-r--r--evtest-capture.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/evtest-capture.c b/evtest-capture.c
index 854139d..3196930 100644
--- a/evtest-capture.c
+++ b/evtest-capture.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <signal.h>
#include <dirent.h>
+#include <errno.h>
#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
@@ -768,6 +769,9 @@ static int print_events(int fd, xmlTextWriterPtr writer)
while(!stop)
{
rc = read(fd, &ev, sizeof(struct input_event));
+ if (rc == -1 && errno == EINTR)
+ continue;
+
if (rc < sizeof(ev))
goto error;