From 0ec80a0dc05cb2e1ea28c6a489b1e0e706e8dba4 Mon Sep 17 00:00:00 2001 From: Dridi Boukelmoune Date: Fri, 2 Feb 2024 19:41:27 +0100 Subject: [PATCH] vtcp: Use VTIM_poll_timeout() in VTCP_read() --- lib/libvarnish/vtcp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c index d46142b467b..3ee958ae606 100644 --- a/lib/libvarnish/vtcp.c +++ b/lib/libvarnish/vtcp.c @@ -643,10 +643,7 @@ VTCP_read(int fd, void *ptr, size_t len, vtim_dur tmo) pfd[0].fd = fd; pfd[0].events = POLLIN; pfd[0].revents = 0; - j = (int)floor(tmo * 1e3); - if (j == 0) - j++; - j = poll(pfd, 1, j); + j = VTIM_poll_timeout(pfd, 1, tmo); if (j == 0) return (-2); }