Fix error on initialisation
[src/app-framework-binder.git] / src / main.c
index 0e97c8a..6b89aef 100644 (file)
@@ -529,10 +529,15 @@ static void run_startup_calls()
  | job for starting the daemon
  +--------------------------------------------------------- */
 
-static void start()
+static void start(int signum)
 {
        struct afb_hsrv *hsrv;
 
+       if (signum) {
+               ERROR("start aborted: received signal %s", strsignal(signum));
+               exit(1);
+       }
+
        // ------------------ sanity check ----------------------------------------
        if (config->httpdPort <= 0) {
                ERROR("no port is defined");
@@ -573,6 +578,8 @@ static void start()
                afb_hook_create_ditf(NULL, config->traceditf, NULL, NULL);
        if (config->tracesvc)
                afb_hook_create_svc(NULL, config->tracesvc, NULL, NULL);
+       if (config->traceevt)
+               afb_hook_create_evt(NULL, config->traceevt, NULL, NULL);
 
        /* load bindings */
        apiset_start_list(config->dbus_clients, afb_api_dbus_add_client, "the afb-dbus client");