]> arthur.barton.de Git - ngircd.git/commitdiff
Log received signals (using strsignal(3), when available)
authorAlexander Barton <alex@barton.de>
Sun, 10 Nov 2019 20:12:39 +0000 (21:12 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 10 Nov 2019 20:12:43 +0000 (21:12 +0100)
configure.ng
contrib/MacOSX/config.h
src/ngircd/sighandlers.c

index 367c2f0cc59a9c386d11c2fab3f5239a30aba22f..a3855dbebee95b1bd33059ce16b16a87abb9a4a5 100644 (file)
@@ -265,6 +265,7 @@ AC_CHECK_FUNCS_ONCE([
        strlcat \
        strlcpy \
        strndup \
+       strsignal \
        strtok_r \
        unsetenv \
        vsnprintf \
index 761a68e1e2a61ad64ad5e9ffc92dfd14b8d06f95..60bb630f03fb74de6c329ca09b08ee61bea4b9db 100644 (file)
 #define HAVE_SIGACTION 1
 /* Define to 1 if you have the `setsid' function. */
 #define HAVE_SETSID 1
+/* Define to 1 if you have the `strsignal' function. */
+#define HAVE_STRSIGNAL 1
 
 /* Define if socklen_t exists */
 #define HAVE_socklen_t 1
index 6244846fb4b020275137f3f2189041c16a036c0c..f7ae4f45708084f04a375f9482a2ad3913f36d97 100644 (file)
@@ -154,6 +154,14 @@ Rehash(void)
 static void
 Signal_Handler(int Signal)
 {
+       if (Signal != SIGCHLD) {
+#ifdef HAVE_STRSIGNAL
+               Log(LOG_INFO, "Got signal \"%s\" ...", strsignal(Signal));
+#else
+               Log(LOG_INFO, "Got signal %d ...", Signal);
+#endif
+       }
+
        switch (Signal) {
        case SIGTERM:
        case SIGINT: