_E("Received SIGTERM(%d) from %s(%d)\n", signo, proc_name, info->si_pid);
- /* TODO: Refactoring */
- raise(SIGKILL);
+ server::get_instance().stop();
}
static void signal_init(void)
sig_act.sa_sigaction = sig_term_handler;
sig_act.sa_flags = SA_SIGINFO;
sigaction(SIGTERM, &sig_act, NULL);
+ sigaction(SIGABRT, &sig_act, NULL);
+ sigaction(SIGINT, &sig_act, NULL);
}
static void set_cal_data(void)
}
fprintf(fp, "%d", SET_CAL);
- fclose(fp);
+
+ if (fp)
+ fclose(fp);
_I("Succeeded to set calibration data");
set_cal_data();
+ /* TODO: loader has to be moved to server */
sensor_loader::get_instance().load();
server::get_instance().run();
-
server::get_instance().stop();
_I("Sensord terminated");
+
return 0;
}