From: Bartosz Golaszewski Date: Tue, 2 May 2017 21:58:43 +0000 (+0200) Subject: core: fix the return value of gpiod_simple_event_loop() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=657c0a957e56998c878819147af019dbf713fa4f;p=qemu-gpiodev%2Flibgpiod.git core: fix the return value of gpiod_simple_event_loop() This routine should always return 0 when no errors were encountered. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/lib/core.c b/src/lib/core.c index cefa985..1d46a04 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -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: