core: fix the return value of gpiod_simple_event_loop()
authorBartosz Golaszewski <bartekgola@gmail.com>
Tue, 2 May 2017 21:58:43 +0000 (23:58 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 3 May 2017 06:53:00 +0000 (08:53 +0200)
This routine should always return 0 when no errors were encountered.

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

index cefa9859c3230c51882b921a5e42ff628faf2342..1d46a041c6467b217bd1e272ac262af958d46587 100644 (file)
@@ -314,8 +314,10 @@ int gpiod_simple_event_loop(const char *consumer, const char *device,
                }
 
                status = callback(evtype, &event.ts, cbdata);
-               if (status == GPIOD_EVENT_CB_STOP)
+               if (status == GPIOD_EVENT_CB_STOP) {
+                       status = 0;
                        goto out;
+               }
        }
 
 out: