From b33d512c6a09a87b0dd5d7d24d3d9eb409452c72 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Wed, 11 Jan 2017 13:17:01 +0100 Subject: [PATCH] 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 --- core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 { -- 2.30.2