]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fix assert-crash when using only non-delayed signals
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 31 Dec 2021 09:28:09 +0000 (11:28 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 19 Jan 2022 12:29:07 +0000 (12:29 +0000)
Fixes:
Panic: file lib-signals.c: line 190 (lib_signals_init_io): assertion failed: (sig_pipe_fd[0] != -1)

src/lib/lib-signals.c

index 6ac657a045ea0c809f7d6d5cd049b313c43b3be2..40fab80de7ec7b14bcd46f1bbf8bee726e4243d1 100644 (file)
@@ -187,7 +187,10 @@ lib_signals_ioloop_find(struct ioloop *ioloop)
 
 static void lib_signals_init_io(struct signal_ioloop *l)
 {
-       i_assert(sig_pipe_fd[0] != -1);
+       if (sig_pipe_fd[0] == -1) {
+               /* no delayed signals */
+               return;
+       }
 
        l->io = io_add_to(l->ioloop, sig_pipe_fd[0], IO_READ, signal_read, NULL);
        io_set_never_wait_alone(l->io, signals_expected == 0);