From f4f875c5ab8c2e74ffa4af1cdc7a43050714ed42 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 30 Mar 2024 16:14:21 +0000 Subject: Correct/improve signal handling logging. --- blabouncer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'blabouncer.c') 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 { -- cgit v1.2.3