From e5817664738e613155078ddea66c9dde73339ac1 Mon Sep 17 00:00:00 2001 From: dormando Date: Thu, 29 Oct 2020 16:41:24 -0700 Subject: logger: fix spurious watcher hangups of course the previous commit didn't actually fix the bug: during poll() call we weren't filtering for the right watcher when we were polling a specific one. This could lead to reading a POLLHUP on the wrong socket and other issues. hopefully that solves some mysteries with the watcher system. --- logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'logger.c') diff --git a/logger.c b/logger.c index cb92d64..4a38734 100644 --- a/logger.c +++ b/logger.c @@ -447,7 +447,7 @@ static int logger_thread_poll_watchers(int force_poll, int watcher) { nfd = 0; for (x = 0; x < WATCHER_LIMIT; x++) { logger_watcher *w = watchers[x]; - if (w == NULL) + if (w == NULL || (watcher != WATCHER_ALL && x != watcher)) continue; data_size = 0; -- cgit v1.2.1