Use strsignal() for signal-logging
This also makes clearer what happens when you do not know the abbreviations well.
This commit is contained in:
parent
abec80e6ce
commit
1e23378afd
1 changed files with 1 additions and 9 deletions
10
quark.c
10
quark.c
|
@ -459,14 +459,6 @@ serve(int fd) {
|
|||
|
||||
void
|
||||
sighandler(int sig) {
|
||||
static const char *signame[64] = {
|
||||
[SIGHUP] = "SIGHUP",
|
||||
[SIGINT] = "SIGINT",
|
||||
[SIGQUIT] = "SIGQUIT",
|
||||
[SIGABRT] = "SIGABRT",
|
||||
[SIGTERM] = "SIGTERM",
|
||||
[SIGCHLD] = "SIGCHLD"
|
||||
};
|
||||
switch(sig) {
|
||||
default: break;
|
||||
case SIGHUP:
|
||||
|
@ -474,7 +466,7 @@ sighandler(int sig) {
|
|||
case SIGQUIT:
|
||||
case SIGABRT:
|
||||
case SIGTERM:
|
||||
logerrmsg("received signal %s, closing down\n", signame[sig] ? signame[sig] : "");
|
||||
logerrmsg("received signal: %s, closing down\n", strsignal(sig));
|
||||
close(fd);
|
||||
running = 0;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue