Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8735:f8fdabb30c0a HEAD
master: Don't crash if auth process dies too early.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 09 Feb 2009 19:44:07 -0500 |
parents | f8e407d832b8 |
children | d23ab2c1c0c5 |
files | src/master/auth-process.c src/master/child-process.c src/master/child-process.h |
diffstat | 3 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/master/auth-process.c Fri Feb 06 18:08:56 2009 -0500 +++ b/src/master/auth-process.c Mon Feb 09 19:44:07 2009 -0500 @@ -355,7 +355,7 @@ 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"); }
--- a/src/master/child-process.c Fri Feb 06 18:08:56 2009 -0500 +++ b/src/master/child-process.c Mon Feb 09 19:44:07 2009 -0500 @@ -219,10 +219,15 @@ 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); }