blob: ea4e6eb014fd12e31859798b057bf2b764e581af (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
--- moreutils-parallel.c.orig 2015-01-19 18:03:51 UTC
+++ moreutils-parallel.c
@@ -112,6 +113,7 @@ void exec_child(char **command, char **a
return;
}
+#ifdef HAVE_WAITID
int wait_for_child(int options) {
id_t id_ignored = 0;
siginfo_t infop;
@@ -126,6 +128,18 @@ int wait_for_child(int options) {
}
return 1;
}
+#else
+int wait_for_child(int options) {
+ int status;
+
+ if(waitpid(-1, &status, options) == -1)
+ return -1; /* nothing to wait for */
+ if(WIFEXITED(status))
+ return WEXITSTATUS(status);
+ return 1;
+}
+#endif
+
static int pipe_child(int fd, int orig_fd)
{
|