/* when we catch a signal and want to exit we call this function to do it gracefully */ static void mk_signal_exit() { /* ignore future signals to properly handle the cleanup */ signal(SIGTERM, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); mk_exit_all(); mk_info("Exiting... >:("); _exit(EXIT_SUCCESS); }
/* when we catch a signal and want to exit we call this function to do it gracefully */ static void mk_signal_exit() { /* ignore future signals to properly handle the cleanup */ signal(SIGTERM, SIG_IGN); signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); mk_user_undo_uidgid(); mk_utils_remove_pid(mk_config->path_conf_pidfile); mk_exit_all(); mk_info("Exiting... >:("); _exit(EXIT_SUCCESS); }