summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/util.c b/util.c
index 99448959e9..560ec7db04 100644
--- a/util.c
+++ b/util.c
@@ -2099,11 +2099,17 @@ int flags;
}
}
#ifdef HAS_WAITPID
+# ifdef HAS_WAITPID_RUNTIME
+ if (!HAS_WAITPID_RUNTIME)
+ goto hard_way;
+# endif
return waitpid(pid,statusp,flags);
-#else
-#ifdef HAS_WAIT4
+#endif
+#if !defined(HAS_WAITPID) && defined(HAS_WAIT4)
return wait4((pid==-1)?0:pid,statusp,flags,Null(struct rusage *));
-#else
+#endif
+#if !defined(HAS_WAITPID) && !defined(HAS_WAIT4) || defined(HAS_WAITPID_RUNTIME)
+ hard_way:
{
I32 result;
if (flags)
@@ -2117,7 +2123,6 @@ int flags;
return result;
}
#endif
-#endif
}
#endif /* !DOSISH */