diff options
| author | Alexander Barton <alex@barton.de> | 2019-11-10 21:12:39 +0100 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2019-11-10 21:12:43 +0100 |
| commit | de1de4055123e95fd9dc1b7e40c69a760777079d (patch) | |
| tree | a8781aaafb241acca96ecf63fd991b2e221ba8f6 | |
| parent | 4169cb25e620cbd8a54cd19b509a8f88d7c295f9 (diff) | |
| download | ngircd-de1de4055123e95fd9dc1b7e40c69a760777079d.tar.gz ngircd-de1de4055123e95fd9dc1b7e40c69a760777079d.zip | |
Log received signals (using strsignal(3), when available)
| -rw-r--r-- | configure.ng | 1 | ||||
| -rw-r--r-- | contrib/MacOSX/config.h | 2 | ||||
| -rw-r--r-- | src/ngircd/sighandlers.c | 8 |
3 files changed, 11 insertions, 0 deletions
diff --git a/configure.ng b/configure.ng index 367c2f0c..a3855dbe 100644 --- a/configure.ng +++ b/configure.ng @@ -265,6 +265,7 @@ AC_CHECK_FUNCS_ONCE([ strlcat \ strlcpy \ strndup \ + strsignal \ strtok_r \ unsetenv \ vsnprintf \ diff --git a/contrib/MacOSX/config.h b/contrib/MacOSX/config.h index 761a68e1..60bb630f 100644 --- a/contrib/MacOSX/config.h +++ b/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 diff --git a/src/ngircd/sighandlers.c b/src/ngircd/sighandlers.c index 6244846f..f7ae4f45 100644 --- a/src/ngircd/sighandlers.c +++ b/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: |