diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-09-23 16:57:33 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-09-23 16:57:33 -0400 |
commit | 3c83bf4e1920be909f65945e56dc8b779c472a59 (patch) | |
tree | 1c621c6d2da6220c7db56a4a5b7a6ad76491e503 | |
parent | 99a49c0add96bfb75a65ccebb922378f3975f7d9 (diff) | |
download | bfs-3c83bf4e1920be909f65945e56dc8b779c472a59.tar.xz |
exec: Output a human-readable description of terminating signals
-rw-r--r-- | exec.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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]); } |