ports/sysutils/moreutils/files/patch-parallel.c
Pav Lucistnik acf3097b94 - Update to 0.38
PR:		ports/143827
Submitted by:	Charlie Kester <corky1951@comcast.net> (maintainer)
2010-02-12 09:23:58 +00:00

30 lines
597 B
C

--- parallel.c.orig 2010-02-09 12:39:08.000000000 -0800
+++ parallel.c 2010-02-09 22:27:25.000000000 -0800
@@ -76,6 +76,7 @@
return;
}
+#ifdef HAVE_WAITID
int wait_for_child(int options) {
id_t id_ignored = 0;
siginfo_t infop;
@@ -88,6 +89,18 @@
return infop.si_status;
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
+
int main(int argc, char **argv) {
int maxjobs = -1;