X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fnet.c;h=8ee782145cbd9b28a5d12734b50022db2dffd7ce;hb=08aabbf9317806bc50a9a6693ca866c8936ce26b;hp=4a680d8e51ebd2ba40dc29418e5fdccfddac9f71;hpb=f0a57eab4cfd64d4f8261b1885a2072177f9e76b;p=oweals%2Ftinc.git diff --git a/src/net.c b/src/net.c index 4a680d8..8ee7821 100644 --- a/src/net.c +++ b/src/net.c @@ -1,7 +1,7 @@ /* net.c -- most of the network code Copyright (C) 1998-2005 Ivo Timmermans, - 2000-2006 Guus Sliepen + 2000-2009 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -203,7 +203,7 @@ static void timeout_handler(int fd, short events, void *event) { void handle_meta_connection_data(int fd, short events, void *data) { connection_t *c = data; int result; - socklen_t len = sizeof(result); + socklen_t len = sizeof result; if(c->status.connecting) { c->status.connecting = false; @@ -234,13 +234,16 @@ static void sigterm_handler(int signal, short events, void *data) { } 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; char *fname; struct stat s; static time_t last_config_check = 0; - - logger(LOG_NOTICE, _("Got %s signal"), strsignal(signal)); /* Reread our own configuration file */ @@ -250,7 +253,7 @@ static void sighup_handler(int signal, short events, void *data) { if(!read_server_config()) { logger(LOG_ERR, _("Unable to reread configuration file, exitting.")); event_loopexit(NULL); - return; + return EINVAL; } /* Close connections to hosts that have a changed or deleted host config file */ @@ -278,6 +281,8 @@ static void sighup_handler(int signal, short events, void *data) { /* Try to make outgoing connections */ try_outgoing_connections(); + + return 0; } void retry(void) {