Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix waitpid on dfly and old freebsd versions
Baptiste Daroussin committed 12 years ago
commit 3707212c74106c47c99d857a707a8f20b82d2e77
parent 1e87ff1
1 file changed +5 -2
modified src/main.c
@@ -38,6 +38,7 @@

#include <assert.h>
#include <err.h>
+
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
@@ -434,8 +435,10 @@ start_process_worker(void)
			if (child_pid == -1)
				err(EX_OSERR, "Failed to fork worker process");

-
			if (waitpid(child_pid, &status, WEXITED) == -1)
-
				err(EX_OSERR, "Child process pid=%d", child_pid); 
+
			while (waitpid(child_pid, &status, 0) == -1) {
+
				if (errno != EINTR)
+
					err(EX_OSERR, "Child process pid=%d", child_pid);
+
			}

			ret = WEXITSTATUS(status);