main: install signal handler sooner

This commit is contained in:
Miroslav Lichvar 2015-09-04 12:19:44 +02:00
parent 3391d5f846
commit ea2858b323

4
main.c
View file

@ -517,6 +517,8 @@ int main
/* From now on, it is safe to do finalisation on exit */ /* From now on, it is safe to do finalisation on exit */
initialised = 1; initialised = 1;
UTI_SetQuitSignalsHandler(signal_cleanup);
CAM_OpenUnixSocket(); CAM_OpenUnixSocket();
if (ref_mode == REF_ModeNormal && CNF_GetInitSources() > 0) { if (ref_mode == REF_ModeNormal && CNF_GetInitSources() > 0) {
@ -532,8 +534,6 @@ int main
post_init_rtc_hook(NULL); post_init_rtc_hook(NULL);
} }
UTI_SetQuitSignalsHandler(signal_cleanup);
/* The program normally runs under control of the main loop in /* The program normally runs under control of the main loop in
the scheduler. */ the scheduler. */
SCH_MainLoop(); SCH_MainLoop();