From: Bartosz Golaszewski Date: Wed, 11 Jan 2017 12:17:01 +0000 (+0100) Subject: event: tweak gpiod_simple_event_loop() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b33d512c6a09a87b0dd5d7d24d3d9eb409452c72;p=qemu-gpiodev%2Flibgpiod.git event: tweak gpiod_simple_event_loop() If the internal system call is interrupted by a signal - just act as if the wait timed out. Signed-off-by: Bartosz Golaszewski --- diff --git a/core.c b/core.c index e50a2e6..e139f22 100644 --- a/core.c +++ b/core.c @@ -277,7 +277,10 @@ int gpiod_simple_event_loop(const char *device, unsigned int offset, for (;;) { status = gpiod_line_event_wait(line, timeout); if (status < 0) { - goto out; + if (gpiod_errno() == EINTR) + return evtype = GPIOD_EVENT_CB_TIMEOUT; + else + goto out; } else if (status == 0) { evtype = GPIOD_EVENT_CB_TIMEOUT; } else {