From 9fbc20e75d9d333b0c8c66cd1f2ebf6f4ea46f4e Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 6 Feb 2017 12:34:34 +0100 Subject: [PATCH] core: really fix event requests The previous commit addressing the issue when requesting both types of line events was braindead. Actually fix the bug this time: check the event_type, not the eventflags. Signed-off-by: Bartosz Golaszewski --- src/lib/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/core.c b/src/lib/core.c index f5beeb7..aa8f6a8 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -774,7 +774,7 @@ int gpiod_line_event_request(struct gpiod_line *line, req->eventflags |= GPIOEVENT_EVENT_RISING_EDGE; else if (config->event_type == GPIOD_EVENT_FALLING_EDGE) req->eventflags |= GPIOEVENT_EVENT_FALLING_EDGE; - else if (req->eventflags == GPIOD_EVENT_BOTH_EDGES) + else if (config->event_type == GPIOD_EVENT_BOTH_EDGES) req->eventflags |= GPIOEVENT_REQUEST_BOTH_EDGES; chip = gpiod_line_get_chip(line); -- 2.30.2