]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: Don't crash if auth process dies too early.
authorTimo Sirainen <tss@iki.fi>
Tue, 10 Feb 2009 00:44:07 +0000 (19:44 -0500)
committerTimo Sirainen <tss@iki.fi>
Tue, 10 Feb 2009 00:44:07 +0000 (19:44 -0500)
--HG--
branch : HEAD

src/master/auth-process.c
src/master/child-process.c
src/master/child-process.h

index a0804be567fff9d668613bcacb38f3c6c532e299..894ce19976fb397675ff96bdc679a79d24e8fb07 100644 (file)
@@ -355,7 +355,7 @@ static void auth_process_destroy(struct auth_process *p)
 
        if (!p->initialized && io_loop_is_running(ioloop) && !p->external) {
                /* log the process exit and kill ourself */
-               child_processes_deinit();
+               child_processes_flush();
                log_deinit();
                i_fatal("Auth process died too early - shutting down");
        }
index ad285421e2083c284e2c9189d10494a956f432dc..1b0c365111049e98fb4ecfd73be2b33a564f8604 100644 (file)
@@ -219,10 +219,15 @@ void child_processes_init(void)
        lib_signals_set_handler(SIGCHLD, TRUE, sigchld_handler, NULL);
 }
 
-void child_processes_deinit(void)
+void child_processes_flush(void)
 {
        /* make sure we log if child processes died unexpectedly */
        sigchld_handler(SIGCHLD, NULL);
+}
+
+void child_processes_deinit(void)
+{
+       child_processes_flush();
        lib_signals_unset_handler(SIGCHLD, sigchld_handler, NULL);
        hash_table_destroy(&processes);
 }
index c98b832cefc7cf21bd44ec5b2fe02ebf9992212c..457a9ca1bef537cba547a508f478f791bffe250d 100644 (file)
@@ -40,6 +40,7 @@ void child_process_set_destroy_callback(enum process_type type,
                                        child_process_destroy_callback_t *cb);
 
 void child_processes_init(void);
+void child_processes_flush(void);
 void child_processes_deinit(void);
 
 #endif