From: Timo Sirainen Date: Tue, 10 Feb 2009 00:44:07 +0000 (-0500) Subject: master: Don't crash if auth process dies too early. X-Git-Tag: 1.2.beta1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fceb63c9694bd0118a1581016253e58a9cceafc;p=thirdparty%2Fdovecot%2Fcore.git master: Don't crash if auth process dies too early. --HG-- branch : HEAD --- diff --git a/src/master/auth-process.c b/src/master/auth-process.c index a0804be567..894ce19976 100644 --- a/src/master/auth-process.c +++ b/src/master/auth-process.c @@ -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"); } diff --git a/src/master/child-process.c b/src/master/child-process.c index ad285421e2..1b0c365111 100644 --- a/src/master/child-process.c +++ b/src/master/child-process.c @@ -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); } diff --git a/src/master/child-process.h b/src/master/child-process.h index c98b832cef..457a9ca1be 100644 --- a/src/master/child-process.h +++ b/src/master/child-process.h @@ -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