From 3c83bf4e1920be909f65945e56dc8b779c472a59 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 23 Sep 2020 16:57:33 -0400 Subject: exec: Output a human-readable description of terminating signals --- exec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 7c199a3..e6df2dc 100644 --- a/exec.c +++ b/exec.c @@ -390,7 +390,11 @@ fail: } } else if (WIFSIGNALED(wstatus)) { int sig = WTERMSIG(wstatus); - bfs_warning(execbuf->cmdline, "Command '${ex}%s${rs}' terminated by signal %d\n", execbuf->argv[0], sig); + const char *str = strsignal(sig); + if (!str) { + str = "unknown"; + } + bfs_warning(execbuf->cmdline, "Command '${ex}%s${rs}' terminated by signal %d (%s)\n", execbuf->argv[0], sig, str); } else { bfs_warning(execbuf->cmdline, "Command '${ex}%s${rs}' terminated abnormally\n", execbuf->argv[0]); } -- cgit v1.2.3