1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-12 01:40:27 +00:00

Log received signals (using strsignal(3), when available)

This commit is contained in:
Alexander Barton 2019-11-10 21:12:39 +01:00
parent 4169cb25e6
commit de1de40551
3 changed files with 11 additions and 0 deletions

View File

@ -265,6 +265,7 @@ AC_CHECK_FUNCS_ONCE([
strlcat \ strlcat \
strlcpy \ strlcpy \
strndup \ strndup \
strsignal \
strtok_r \ strtok_r \
unsetenv \ unsetenv \
vsnprintf \ vsnprintf \

View File

@ -113,6 +113,8 @@
#define HAVE_SIGACTION 1 #define HAVE_SIGACTION 1
/* Define to 1 if you have the `setsid' function. */ /* Define to 1 if you have the `setsid' function. */
#define HAVE_SETSID 1 #define HAVE_SETSID 1
/* Define to 1 if you have the `strsignal' function. */
#define HAVE_STRSIGNAL 1
/* Define if socklen_t exists */ /* Define if socklen_t exists */
#define HAVE_socklen_t 1 #define HAVE_socklen_t 1

View File

@ -154,6 +154,14 @@ Rehash(void)
static void static void
Signal_Handler(int Signal) 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) { switch (Signal) {
case SIGTERM: case SIGTERM:
case SIGINT: case SIGINT: