]> sigrok.org Git - libsigrok.git/commitdiff
tcp: Avoid blocking in sr_fd_is_readable if using poll
authorCharlie Birks <redacted>
Sat, 7 Dec 2024 18:11:08 +0000 (18:11 +0000)
committerSoeren Apel <redacted>
Sun, 9 Nov 2025 22:11:37 +0000 (23:11 +0100)
This is consistent with the select path and the function description.

src/tcp.c

index fe8e24d8f0e3915db739b537390daeaa8d740bdb..33074b5c23ec7d7ac63b9f958b4de24fabac22d3 100644 (file)
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -84,7 +84,7 @@ SR_PRIV gboolean sr_fd_is_readable(int fd)
        memset(fds, 0, sizeof(fds));
        fds[0].fd = fd;
        fds[0].events = POLLIN;
-       ret = poll(fds, ARRAY_SIZE(fds), -1);
+       ret = poll(fds, ARRAY_SIZE(fds), 0);
        if (ret < 0)
                return FALSE;
        if (!ret)