simple: event-loop: fix EINTR handling
authorBartosz Golaszewski <bartekgola@gmail.com>
Mon, 25 Sep 2017 18:22:03 +0000 (20:22 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Mon, 25 Sep 2017 18:22:03 +0000 (20:22 +0200)
We want to handle EINTR as a timeout event. Don't return here.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/simple.c

index 12766e6769f1dd43e908244e6f2286cf86d26d50..c2905c51af6ebbf49783f1fef42d07b8b4c21e3f 100644 (file)
@@ -167,7 +167,7 @@ int gpiod_simple_event_loop(const char *consumer, const char *device,
                status = gpiod_line_event_wait(line, timeout);
                if (status < 0) {
                        if (errno == EINTR)
-                               return evtype = GPIOD_EVENT_CB_TIMEOUT;
+                               evtype = GPIOD_EVENT_CB_TIMEOUT;
                        else
                                goto out;
                } else if (status == 0) {