From: Trent Huber Date: Sat, 26 Jul 2025 16:12:42 +0000 (-0400) Subject: Message for child process terminated by signal X-Git-Url: https://trenthuber.com/code?a=commitdiff_plain;h=4711a83fafa0282fadeaba701a25539b3e73d073;p=cbs.git Message for child process terminated by signal --- diff --git a/cbs.c b/cbs.c index 53c44f8..8bc47d9 100644 --- a/cbs.c +++ b/cbs.c @@ -77,8 +77,9 @@ void await(pid_t cpid, char *what, char *who) { if (cpid == -1 || waitpid(cpid, &status, 0) == -1) err(EXIT_FAILURE, "Unable to %s `%s'", what, who); - if (WIFEXITED(status) && WEXITSTATUS(status) != EXIT_SUCCESS - || WIFSIGNALED(status)) + if (WIFSIGNALED(status)) + errx(EXIT_FAILURE, "%s", strsignal(WTERMSIG(status))); + if (WIFEXITED(status) && WEXITSTATUS(status) != EXIT_SUCCESS) exit(EXIT_FAILURE); }