From f868633a2164c1e7e8772246bf830d16ffe400a4 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Fri, 29 Sep 2017 15:31:12 +0200 Subject: [PATCH] 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 --- src/tools/gpiomon.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.30.2