[libgpiod][PATCH] core: make the chip file descriptor blocking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 lib/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/chip.c b/lib/chip.c
index 507c79d..7d4d21e 100644
--- a/lib/chip.c
+++ b/lib/chip.c
@@ -30,7 +30,7 @@ GPIOD_API struct gpiod_chip *gpiod_chip_open(const char *path)
 	if (!gpiod_check_gpiochip_device(path, true))
 		return NULL;
 
-	fd = open(path, O_RDWR | O_CLOEXEC | O_NONBLOCK);
+	fd = open(path, O_RDWR | O_CLOEXEC);
 	if (fd < 0)
 		return NULL;
 
-- 
2.37.2




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux