Avoid to stick on event loop
[src/app-framework-binder.git] / src / main.c
index 1c85411..cee5596 100644 (file)
@@ -99,11 +99,10 @@ static void start_list(struct afb_config_list *list,
  +--------------------------------------------------------- */
 static void exit_handler()
 {
-       /* TODO: check whether using SIGHUP isn't better */
        if (SELF_PGROUP)
-               killpg(0, SIGKILL);
+               killpg(0, SIGHUP);
        else if (childpid > 0)
-               killpg(childpid, SIGKILL);
+               killpg(childpid, SIGHUP);
 }
 
 /*----------------------------------------------------------
@@ -412,7 +411,7 @@ static void start()
                goto error;
        }
 
-       afb_api_so_set_timeout(config->apiTimeout);
+       afb_apis_set_timeout(config->apiTimeout);
        start_list(config->dbus_clients, afb_api_dbus_add_client, "the afb-dbus client");
        start_list(config->ws_clients, afb_api_ws_add_client, "the afb-websocket client");
        start_list(config->ldpaths, afb_api_so_add_pathset, "the binding path set");
@@ -489,7 +488,7 @@ int main(int argc, char *argv[])
        }
 
        /* handle groups */
-//     atexit(exit_handler);
+       atexit(exit_handler);
 
        /* ignore any SIGPIPE */
        signal(SIGPIPE, SIG_IGN);