core: make the chip file descriptor blocking
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 10 Mar 2023 09:24:04 +0000 (10:24 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Sun, 12 Mar 2023 13:44:27 +0000 (14:44 +0100)
commit6f4b3297b1b61ebb065eb647eb7f6347f315898a
tree57e118159d8b91f4ef9a509dc7e45e0092a7972f
parent369fc1d3ae86751dfca0b1555b9c4cbf5c1f40e1
core: make the chip file descriptor blocking

After discussing this a while back we removed the call to fcntl() that
would make the request file descriptor non-blocking so that a call to
gpiod_line_request_read_edge_events() would block if no events are
pending. We agreed that the same behavior should apply to info events and
made the docs state that. Unfortunately we still pass the O_NONBLOCK flag
to open() making read() called on the chip file descriptor return
immediately if no info events are pending. Fix it by removing this flag.

Fixes: b7ba732e6a93 ("treewide: libgpiod v2 implementation")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
lib/chip.c