From ac579e8e3f56f3eadb3426ef97d50f6ab643dc57 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Fri, 10 May 2013 17:26:12 -0700 Subject: Use strsignal(3) which is more standard than sig2str() Signed-off-by: Alan Coopersmith --- src/server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server.c b/src/server.c index e73eb08..cc853bf 100644 --- a/src/server.c +++ b/src/server.c @@ -755,10 +755,11 @@ XhivWaitServer(pid_t server_pid) { return exitstat; } else if (WIFSIGNALED(pidstat)) { int sig = WTERMSIG(pidstat); - char signame[SIG2STR_MAX]; + const char *signame; - if (sig2str(sig, signame) == -1) - snprintf(signame, sizeof(signame), "unknown"); + signame = strsignal(sig); + if (signame == NULL) + signame = "unknown"; fprintf(stderr, "Server %ld killed by signal %d (%s)%s.\n", (long) server_pid, sig, signame, -- cgit v1.2.3