From: Charlie Birks Date: Sat, 7 Dec 2024 18:11:08 +0000 (+0000) Subject: tcp: Avoid blocking in sr_fd_is_readable if using poll X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8a77fe48275640c519689e7950815c81456dcaf4;p=libsigrok.git tcp: Avoid blocking in sr_fd_is_readable if using poll This is consistent with the select path and the function description. --- diff --git a/src/tcp.c b/src/tcp.c index fe8e24d8..33074b5c 100644 --- 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)