# HG changeset patch # User jbe # Date 1496764560 -7200 # Node ID d4fdc4ed4d813e438f3bfe144fe7e04f98ba4a4c # Parent 42b85f65327cb9be95adf11026fa20f7a9fa3807 Avoid duplicate shutdown diff -r 42b85f65327c -r d4fdc4ed4d81 moonbridge.c --- a/moonbridge.c Tue Jun 06 11:25:07 2017 +0200 +++ b/moonbridge.c Tue Jun 06 17:56:00 2017 +0200 @@ -1154,6 +1154,7 @@ moonbr_log(LOG_WARNING, "Error while sending SIGTERM to own process group: %s", strerror(errno)); } } + moonbr_cond_terminate = 0; /* ignore SIGTERM received by killpg() */ } @@ -1553,10 +1554,7 @@ moonbr_log(LOG_WARNING, "Fast shutdown requested"); moonbr_terminate(MOONBR_EXITCODE_GRACEFUL); } - if (moonbr_cond_terminate) { - moonbr_initiate_shutdown(); - moonbr_cond_terminate = 0; - } + if (moonbr_cond_terminate) moonbr_initiate_shutdown(); moonbr_cond_child = 0; /* must not be reset between moonbr_try_destroy_worker() and poll() */ moonbr_now(&now); for (pool=moonbr_first_pool; pool; pool=pool->next_pool) {