diff options
author | Luke Bratch <luke@bratch.co.uk> | 2024-03-30 16:14:21 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2024-03-30 16:14:21 +0000 |
commit | f4f875c5ab8c2e74ffa4af1cdc7a43050714ed42 (patch) | |
tree | d346e097331f3c9dab062cf686482cce0a9ee5b7 | |
parent | 3612ac309895be690c8dc3080898dfb713b8a23e (diff) |
Correct/improve signal handling logging.
-rw-r--r-- | blabouncer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/blabouncer.c b/blabouncer.c index 72118ec..c3443dd 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -510,8 +510,9 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) { if (pselret < 0) { // Error or signal interrupt if (errno == EINTR) { // Signal caught, do signal handling - debugprint(DEBUG_CRIT, "signal '%d' happened, exiting!\n", signum); + debugprint(DEBUG_CRIT, "signal '%d' received!\n", signum); if (signum == SIGHUP) { // REHASH requested + debugprint(DEBUG_SOME, "SIGHUP received, attempting REHASH!\n"); // TODO - This code is duplicated between here and BLABOUNCER REHASH handling char outgoingmsg[MAXDATASIZE]; char failuremsg[MAXDATASIZE]; @@ -534,10 +535,13 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) { // Then go back to the top of the loop continue; } else if (signum == SIGINT) { // Probably Ctrl+C + debugprint(DEBUG_CRIT, "SIGINT received, exiting!\n"); cleanexit(server_ssl, clients, 0, &ircdstate, settings, "SIGINT received"); } else if (signum == SIGTERM) { // Probably `kill` + debugprint(DEBUG_CRIT, "SIGTERM received, exiting!\n"); cleanexit(server_ssl, clients, 0, &ircdstate, settings, "SIGTERM received"); } else { + debugprint(DEBUG_CRIT, "Unexpected signal received, exiting!\n"); cleanexit(server_ssl, clients, 0, &ircdstate, settings, "Unexpected signal received"); } } else { |