-#if defined(HAVE_WAIT3)
-#ifdef oldhpux /* HP-UX fixed this sometime between 9.01 and 10.20 */
- while ((pid = wait3(&status, WNOHANG, (int *) 0)) > 0)
+ while ((pid = waitpid(-1, &status, WNOHANG)) > 0)
+ continue; /* swallow 'em up. */
+#elif defined(HAVE_WAIT3) /* the BSD way */
+#if defined(HAVE_UNION_WAIT) && !defined(__FreeBSD__)
+ union wait status;