allow process callback to call uloop_end()
authorJohn Crispin <blogic@openwrt.org>
Sat, 21 Mar 2015 04:49:38 +0000 (05:49 +0100)
committerJohn Crispin <blogic@openwrt.org>
Sat, 21 Mar 2015 04:50:23 +0000 (05:50 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
uloop.c

diff --git a/uloop.c b/uloop.c
index 9ebeca6791b97e313d8b3c82081c778f63fbe056..ea160a06a0f3d9127e021130fb4227e04ce3d1b5 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -680,11 +680,13 @@ void uloop_run(void)
        {
                uloop_gettime(&tv);
                uloop_process_timeouts(&tv);
-               if (uloop_cancelled)
-                       break;
 
                if (do_sigchld)
                        uloop_handle_processes();
+
+               if (uloop_cancelled)
+                       break;
+
                uloop_gettime(&tv);
                uloop_run_events(uloop_get_next_timeout(&tv));
        }