diff options
author | Leah Neukirchen <leah@vuxu.org> | 2024-02-05 18:02:35 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2024-02-05 18:02:35 +0100 |
commit | b90a6de0b51b60b3c5cf9ae9e3163131f7491807 (patch) | |
tree | 641e9b4aaf11a541ba4b364dbd38c73c0400927d | |
parent | 706ec6244ad594e617941d22377d11aaa4cff126 (diff) | |
download | nitro-b90a6de0b51b60b3c5cf9ae9e3163131f7491807.tar.gz nitro-b90a6de0b51b60b3c5cf9ae9e3163131f7491807.tar.xz nitro-b90a6de0b51b60b3c5cf9ae9e3163131f7491807.zip |
report waitpid failures
-rw-r--r-- | nitro.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nitro.c b/nitro.c index 4106bc8..bdca361 100644 --- a/nitro.c +++ b/nitro.c @@ -1414,10 +1414,11 @@ main(int argc, char *argv[]) while (1) { int wstatus = 0; int r = waitpid(-1, &wstatus, WNOHANG); - if (r == 0 || (r < 0 && errno == ECHILD)) + if (r <= 0) { + if (r < 0 && errno != ECHILD) + prn(2, "- nitro: mysterious waitpid error: %d\n", errno); break; - if (r < 0) - abort(); + } has_died(r, wstatus); } |