Commit Diff
Diff:
4169cb25e620cbd8a54cd19b509a8f88d7c295f9
de1de4055123e95fd9dc1b7e40c69a760777079d
Commit:
de1de4055123e95fd9dc1b7e40c69a760777079d
Tree:
a8781aaafb241acca96ecf63fd991b2e221ba8f6
Author:
Alexander Barton <alex@barton.de>
Committer:
Alexander Barton <alex@barton.de>
Date:
Sun Nov 10 20:12:43 2019 UTC
Message:
Log received signals (using strsignal(3), when available)
blob - 367c2f0cc59a9c386d11c2fab3f5239a30aba22f
blob + a3855dbebee95b1bd33059ce16b16a87abb9a4a5
--- configure.ng
+++ configure.ng
@@ -265,6 +265,7 @@ AC_CHECK_FUNCS_ONCE([
strlcat \
strlcpy \
strndup \
+ strsignal \
strtok_r \
unsetenv \
vsnprintf \
blob - 761a68e1e2a61ad64ad5e9ffc92dfd14b8d06f95
blob + 60bb630f03fb74de6c329ca09b08ee61bea4b9db
--- contrib/MacOSX/config.h
+++ contrib/MacOSX/config.h
@@ -113,6 +113,8 @@
#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
blob - 6244846fb4b020275137f3f2189041c16a036c0c
blob + f7ae4f45708084f04a375f9482a2ad3913f36d97
--- src/ngircd/sighandlers.c
+++ src/ngircd/sighandlers.c
@@ -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:
IRCNow