X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fsighandlers.c;h=a219105f4b5aff571e045f22d58f0f5fc4d17162;hp=80eef3e603d3a382f2e31bf8511ce4433c24c218;hb=808c291c76b7ecb4ae13b6ee12e8afe658b627c1;hpb=ba720fcbaeaacee700d7d23936cf481e6fcb83b1 diff --git a/src/ngircd/sighandlers.c b/src/ngircd/sighandlers.c index 80eef3e6..a219105f 100644 --- a/src/ngircd/sighandlers.c +++ b/src/ngircd/sighandlers.c @@ -218,8 +218,11 @@ Signal_Handler_BH(int Signal) break; #ifdef DEBUG case SIGUSR2: - if (NGIRCd_Debug) + if (NGIRCd_Debug) { + Log(LOG_INFO|LOG_snotice, + "Got SIGUSR2, dumping internal state ..."); Dump_State(); + } break; default: Log(LOG_DEBUG, "Got signal %d! Ignored.", Signal); @@ -236,7 +239,7 @@ Signal_Callback(int fd, short UNUSED what) (void) what; do { - ret = read(fd, &sig, sizeof(sig)); + ret = (int)read(fd, &sig, sizeof(sig)); if (ret == sizeof(int)) Signal_Handler_BH(sig); } while (ret == sizeof(int)); @@ -326,11 +329,12 @@ Signals_Exit(void) sigaction(SIGPIPE, &saction, NULL); #else for (i=0; i < C_ARRAY_SIZE(signals_catch) ; i++) - sigaction(signals_catch[i], &saction, NULL); + signal(signals_catch[i], SIG_DFL); signal(SIGPIPE, SIG_DFL); #endif close(signalpipe[1]); close(signalpipe[0]); + signalpipe[0] = signalpipe[1] = 0; } /* -eof- */