From e79c3b24fb1d27f6ba39f42dfe893b709ff4722c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 19 Nov 2010 10:20:36 +0100 Subject: [PATCH] [BUG] debug: report the correct poller list in verbose mode When running with -vv or -V -d, the list of usable polling systems is reported. The final selection did not take into account the possible failures during the tests, which is misleading and could make one think that a non-working poller will be used, while it is not the case. Fix that to really report the correct ones. (cherry picked from commit 6d0e354e0171f08b7b3868ad2882c3663bd068a7) --- src/fd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fd.c b/src/fd.c index c850efa797..80bddd6a0f 100644 --- a/src/fd.c +++ b/src/fd.c @@ -119,11 +119,12 @@ int list_pollers(FILE *out) last = next = -1; while (1) { for (p = 0; p < nbpollers; p++) { - if (!bp || (pollers[p].pref > bp->pref)) - bp = &pollers[p]; if ((next < 0 || pollers[p].pref > next) - && (last < 0 || pollers[p].pref < last)) + && (last < 0 || pollers[p].pref < last)) { next = pollers[p].pref; + if (!bp || (pollers[p].pref > bp->pref)) + bp = &pollers[p]; + } } if (next == -1) @@ -140,8 +141,11 @@ int list_pollers(FILE *out) fprintf(out, " test result OK"); if (next > 0) usable++; - } else + } else { fprintf(out, " test result FAILED"); + if (bp == &pollers[p]) + bp = NULL; + } fprintf(out, "\n"); } }