diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-11-08 22:33:23 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-11-08 22:33:23 +0100 |
| commit | b412a627c2936b4cf8651316e5c27f5579441eff (patch) | |
| tree | 74cc2b2a422a1e8a771160368181713a7000584a | |
| parent | 0fc8c7b1e72475723406a0a8086897d3d05ffdbd (diff) | |
| download | pipeln-b412a627c2936b4cf8651316e5c27f5579441eff.tar.gz pipeln-b412a627c2936b4cf8651316e5c27f5579441eff.zip | |
Fix waitall() condition
| -rw-r--r-- | pipeln.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -112,7 +112,6 @@ waitall(pid_t tpid) int status, exitcode; pid_t pid; - errno = 0; exitcode = 0; do { pid = waitpid(-1, &status, 0); @@ -124,7 +123,7 @@ waitall(pid_t tpid) else if (!exitcode && WIFSIGNALED(status)) exitcode = 128 + WTERMSIG(status); } - } while (pid >= 0 && errno != ECHILD); + } while (pid >= 0 || errno != ECHILD); exit(exitcode); } |
