From: Bartosz Golaszewski Date: Fri, 29 Sep 2017 13:31:12 +0000 (+0200) Subject: gpiomon: correctly handle poll timeouts X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f868633a2164c1e7e8772246bf830d16ffe400a4;p=qemu-gpiodev%2Flibgpiod.git gpiomon: correctly handle poll timeouts We don't check for timeout events in the simple loop event handler. Fix it and return a correct value. Signed-off-by: Bartosz Golaszewski --- diff --git a/src/tools/gpiomon.c b/src/tools/gpiomon.c index 533d578..cabbced 100644 --- a/src/tools/gpiomon.c +++ b/src/tools/gpiomon.c @@ -186,6 +186,9 @@ static int event_callback(int event_type, unsigned int line_offset, { struct mon_ctx *ctx = data; + if (event_type == GPIOD_SIMPLE_EVENT_CB_TIMEOUT) + return GPIOD_SIMPLE_EVENT_CB_RET_OK; + if (!ctx->silent) { if ((event_type == GPIOD_SIMPLE_EVENT_CB_RISING_EDGE && ctx->watch_rising)