-static RETSIGTYPE fatal_signal_square(int a) {
- logger(LOG_ERR, "Got another fatal signal %d (%s): not restarting.", a,
- strsignal(a));
- exit(1);
-}
-
-static RETSIGTYPE fatal_signal_handler(int a) {
- struct sigaction act;
- logger(LOG_ERR, "Got fatal signal %d (%s)", a, strsignal(a));
-
- if(do_detach) {
- logger(LOG_NOTICE, "Trying to re-execute in 5 seconds...");
-
- act.sa_handler = fatal_signal_square;
- act.sa_mask = emptysigset;
- act.sa_flags = 0;
- sigaction(SIGSEGV, &act, NULL);
-
- close_network_connections();
- sleep(5);
- exit_control();
- execvp(g_argv[0], g_argv);
- } else {
- logger(LOG_NOTICE, "Not restarting.");
- exit(1);
- }
-}
-
-static RETSIGTYPE unexpected_signal_handler(int a) {
- logger(LOG_WARNING, "Got unexpected signal %d (%s)", a, strsignal(a));
-}
-