summaryrefslogtreecommitdiffstats
path: root/exec.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-09-23 16:57:33 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-09-23 16:57:33 -0400
commit3c83bf4e1920be909f65945e56dc8b779c472a59 (patch)
tree1c621c6d2da6220c7db56a4a5b7a6ad76491e503 /exec.c
parent99a49c0add96bfb75a65ccebb922378f3975f7d9 (diff)
downloadbfs-3c83bf4e1920be909f65945e56dc8b779c472a59.tar.xz
exec: Output a human-readable description of terminating signals
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c6
1 files changed, 5 insertions, 1 deletions
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]);
}