From 3c7c1736b7d6b6d086e9c5b54b963f8e244e3418 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 9 Apr 2007 16:53:21 +0000 Subject: Use names instead of numbers for reporting signals and trap signals in rc --- src/start-stop-daemon.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/start-stop-daemon.c') diff --git a/src/start-stop-daemon.c b/src/start-stop-daemon.c index fef416cb..b48b7966 100644 --- a/src/start-stop-daemon.c +++ b/src/start-stop-daemon.c @@ -459,13 +459,20 @@ static void handle_signal (int sig) int pid; int status; int serrno = errno; + char signame[10] = { '\0' }; switch (sig) { case SIGINT: + if (! signame[0]) + snprintf (signame, sizeof (signame), "SIGINT"); case SIGTERM: + if (! signame[0]) + snprintf (signame, sizeof (signame), "SIGTERM"); case SIGQUIT: - eerrorx ("%s: caught signal %d, aborting", progname, sig); + if (! signame[0]) + snprintf (signame, sizeof (signame), "SIGQUIT"); + eerrorx ("%s: caught %s, aborting", progname, signame); case SIGCHLD: while (1) -- cgit v1.2.3