commit f4d71c535e071a5fd6f010fb3e0e19911bcbdf44
parent 71f5ddf36a9ee51566d0e878537278e55dea470c
Author: Lucas de Sena <lucas@seninha.org>
Date: Sun, 23 Apr 2023 22:45:33 -0300
fix waitpid call with WNOHANG
From the manual:
> if WNOHANG is specified and there are no stopped or exited
> children, 0 is returned.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/shod.c b/shod.c
@@ -159,7 +159,7 @@ initsignal(void)
sigemptyset(&sa.sa_mask);
if (sigaction(SIGCHLD, &sa, NULL) == -1)
err(1, "sigaction");
- while (waitpid(-1, NULL, WNOHANG) != -1)
+ while (waitpid(-1, NULL, WNOHANG) > 0)
;
}