- if(sigalrm) {
- syslog(LOG_INFO, _("Flushing event queue"));
-
- while(event_tree->head) {
- event = (event_t *) event_tree->head->data;
- event->handler(event->data);
- event_del(event);
- }
- sigalrm = 0;
- }
-
- if(sighup) {
- connection_t *c;
- avl_node_t *node;
- char *fname;
- struct stat s;
-
- sighup = 0;
-
- /* Reread our own configuration file */
-
- exit_configuration(&config_tree);
- init_configuration(&config_tree);
-
- if(read_server_config()) {
- syslog(LOG_ERR, _("Unable to reread configuration file, exitting."));
- exit(1);
- }
-
- /* Close connections to hosts that have a changed or deleted host config file */
-
- for(node = connection_tree->head; node; node = node->next) {
- c = (connection_t *) node->data;
-
- if(c->outgoing) {
- free(c->outgoing->name);
- freeaddrinfo(c->outgoing->ai);
- free(c->outgoing);
- c->outgoing = NULL;
- }
-
- asprintf(&fname, "%s/hosts/%s", confbase, c->name);
- if(stat(fname, &s) || s.st_mtime > last_config_check)
- terminate_connection(c, c->status.active);
- free(fname);
- }
-
- last_config_check = now;