From: Martin Mares Date: Tue, 1 Mar 2011 12:59:26 +0000 (+0100) Subject: Main: Allow main_loop() to be re-entered after shutdown X-Git-Tag: v5.0~128 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5cd75595329529f5dc493231a7d3aef297bf21ca;p=libucw.git Main: Allow main_loop() to be re-entered after shutdown --- diff --git a/ucw/mainloop.c b/ucw/mainloop.c index ca296bbd..1d213c03 100644 --- a/ucw/mainloop.c +++ b/ucw/mainloop.c @@ -709,7 +709,7 @@ process_hooks(struct main_context *m) hook_min == HOOK_DONE && hook_max == HOOK_DONE || m->shutdown) { - DBG("MAIN: Shut down by %s", m->shutdown ? "main_shutdown" : "a hook"); + DBG("MAIN: Shut down by %s", m->shutdown ? "main_shut_down" : "a hook"); return HOOK_SHUTDOWN; } if (hook_max == HOOK_RETRY) @@ -772,6 +772,8 @@ main_loop(void) struct main_context *m = main_current(); main_get_time_ctx(m); + m->shutdown = 0; + for (;;) { timestamp_t wake = m->now + 1000000000;