summaryrefslogtreecommitdiff
path: root/sysutils/moreutils-parallel/files/patch-parallel.c
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2010-12-16 16:31:52 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2010-12-16 16:31:52 +0000
commit5065ade88aa78a3a833d81276b8c5c9a13ed8a55 (patch)
treec669021dfff38739b455f4c77896987c76b22cb8 /sysutils/moreutils-parallel/files/patch-parallel.c
parent- Move parallel and its manpage to sysutils/moreutils-parallel (diff)
- Add moreutils-parallel 0.43 which was split from sysutils/moreutils
PR: ports/152973 Submitted by: Charlie Kester <corky1951@comcast.net>
Diffstat (limited to 'sysutils/moreutils-parallel/files/patch-parallel.c')
-rw-r--r--sysutils/moreutils-parallel/files/patch-parallel.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sysutils/moreutils-parallel/files/patch-parallel.c b/sysutils/moreutils-parallel/files/patch-parallel.c
new file mode 100644
index 000000000000..5e096a506693
--- /dev/null
+++ b/sysutils/moreutils-parallel/files/patch-parallel.c
@@ -0,0 +1,29 @@
+--- ./parallel.c.orig 2010-07-06 12:06:47.000000000 -0700
++++ ./parallel.c 2010-11-17 15:49:57.000000000 -0800
+@@ -87,6 +87,7 @@
+ return;
+ }
+
++#ifdef HAVE_WAITID
+ int wait_for_child(int options) {
+ id_t id_ignored = 0;
+ siginfo_t infop;
+@@ -101,6 +102,18 @@
+ }
+ 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;