From af985e0151c7d12d9dac4fc364b5c50d3db1e1db Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 12 Sep 2022 09:35:44 +0200 Subject: [PATCH] CLEANUP: pollers: remove dead code in the polling loop As reported by Ilya and Coverity in issue #1858, since recent commit eea152ee6 ("BUG/MINOR: signals/poller: ensure wakeup from signals") which removed the test for the global signal flag from the pollers' loop, the remaining "wake" flag doesn't need to be tested since it already participates to zeroing the wait_time and will be caught on the previous line. Let's just remove that test now. --- src/ev_epoll.c | 2 -- src/ev_evports.c | 2 -- src/ev_kqueue.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/ev_epoll.c b/src/ev_epoll.c index 880aa584d..679e5e873 100644 --- a/src/ev_epoll.c +++ b/src/ev_epoll.c @@ -238,8 +238,6 @@ static void _do_poll(struct poller *p, int exp, int wake) } if (timeout || !wait_time) break; - if (wake) - break; if (tick_isset(exp) && tick_is_expired(exp, now_ms)) break; } while (1); diff --git a/src/ev_evports.c b/src/ev_evports.c index 0a7df15d3..38fd18379 100644 --- a/src/ev_evports.c +++ b/src/ev_evports.c @@ -217,8 +217,6 @@ static void _do_poll(struct poller *p, int exp, int wake) break; if (timeout || !wait_time) break; - if (wake) - break; if (tick_isset(exp) && tick_is_expired(exp, now_ms)) break; } while(1); diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index 4796e680a..e80976202 100644 --- a/src/ev_kqueue.c +++ b/src/ev_kqueue.c @@ -191,8 +191,6 @@ static void _do_poll(struct poller *p, int exp, int wake) } if (timeout || !wait_time) break; - if (wake) - break; if (tick_isset(exp) && tick_is_expired(exp, now_ms)) break; } while (1);