int contradicting_add_edge = 0;
int contradicting_del_edge = 0;
+bool running = true;
/* Purge edges and subnets of unreachable nodes. Use carefully. */
if(rand() % 3 == 0) {
logger(LOG_ERR, "Shutting down, check configuration of all nodes for duplicate Names!");
- abort();
+ running = false;
return;
}
}
}
-static void sigterm_handler(int signal, short events, void *data) {
- logger(LOG_NOTICE, "Got %s signal", strsignal(signal));
- exit(0);
-}
-
-static void sighup_handler(int signal, short events, void *data) {
- logger(LOG_NOTICE, "Got %s signal", strsignal(signal));
- reload_configuration();
-}
-
int reload_configuration(void) {
connection_t *c;
splay_node_t *node, *next;
if(!read_server_config()) {
logger(LOG_ERR, "Unable to reread configuration file, exitting.");
- abort();
+ running = false;
return EINVAL;
}
event_add(&timeout_event);
-#ifdef SIGHUP
- signal(SIGHUP, sighup_handler);
-#endif
-#ifdef SIGTERM
- signal(SIGTERM, sigterm_handler);
-#endif
-#ifdef SIGQUIT
- signal(SIGQUIT, sigterm_handler);
-#endif
-
- while(true) {
+ while(running) {
mutex_unlock(&mutex);
usleep(1000000);
mutex_lock(&mutex);