diff options
author | Roy Marples <roy@marples.name> | 2007-04-09 16:53:21 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-04-09 16:53:21 +0000 |
commit | 3c7c1736b7d6b6d086e9c5b54b963f8e244e3418 (patch) | |
tree | 0404eb66de61b5674cc85b678618e54b446ca839 /src/runscript.c | |
parent | 3a20ea36cc7f1ed89186bdfa46ea0dd2c72742ec (diff) |
Use names instead of numbers for reporting signals and trap signals in rc
Diffstat (limited to 'src/runscript.c')
-rw-r--r-- | src/runscript.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/runscript.c b/src/runscript.c index d87d42f0..ad8a251c 100644 --- a/src/runscript.c +++ b/src/runscript.c @@ -94,6 +94,7 @@ static void handle_signal (int sig) pid_t pid; int status; int serrno = errno; + char signame[10] = { '\0' }; switch (sig) { @@ -113,11 +114,17 @@ static void handle_signal (int sig) } } while (! WIFEXITED (status) && ! WIFSIGNALED (status)); break; - + 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", applet, sig); + if (! signame[0]) + snprintf (signame, sizeof (signame), "SIGQUIT"); + eerrorx ("%s: caught %s, aborting", applet, signame); default: eerror ("%s: caught unknown signal %d", applet, sig); |