From: Stephan Bosch Date: Wed, 27 May 2020 10:16:25 +0000 (+0200) Subject: lib-signals: Fix lib_signals_set_expected(). X-Git-Tag: 2.3.13~526 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dcfd2a9177ffb048e945ac4422e64960b34cfbdc;p=thirdparty%2Fdovecot%2Fcore.git lib-signals: Fix lib_signals_set_expected(). The function made no sense at all. Problem found by Coverity. --- diff --git a/src/lib/lib-signals.c b/src/lib/lib-signals.c index f116052956..078fd005e3 100644 --- a/src/lib/lib-signals.c +++ b/src/lib/lib-signals.c @@ -513,8 +513,8 @@ void lib_signals_set_expected(int signo, bool expected, { struct signal_handler *h; - for (signo = 0; signo < MAX_SIGNAL_VALUE; signo++) { - for (h = signal_handlers[signo]; h != NULL; h = h->next) { + for (h = signal_handlers[signo]; h != NULL; h = h->next) { + if (h->handler == handler && h->context == context) { if (h->expected == expected) return; h->expected = expected;