]> mj.ucw.cz Git - libucw.git/commitdiff
Main: Allow main_loop() to be re-entered after shutdown
authorMartin Mares <mj@ucw.cz>
Tue, 1 Mar 2011 12:59:26 +0000 (13:59 +0100)
committerMartin Mares <mj@ucw.cz>
Tue, 1 Mar 2011 12:59:26 +0000 (13:59 +0100)
ucw/mainloop.c

index ca296bbd88541ea42e81ddfe20297c42b8ab17a2..1d213c03bb7416491e648b9da5a21aec486fc8e9 100644 (file)
@@ -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;