$NetBSD: patch-af,v 1.3 2004/10/11 04:54:05 minskim Exp $

--- texk/web2c/lib/coredump.c.orig	Thu Jan 16 13:51:12 1997
+++ texk/web2c/lib/coredump.c
@@ -9,6 +9,7 @@
    you.  Perl has some things to say about these days.  */
 
 #include "config.h"
+#include "ac_config.h"
 
 /* Do not try to compile this Unix-y unportable stuff unless it's needed.  */
 
@@ -29,7 +30,11 @@ funny_core_dump P1H(void)
   }
 #else /* !__EMX__ */
   int pid, w;
+#ifdef HAVE_SYS_WAIT_H
+  int status;
+#else
   union wait status;
+#endif
 
   switch (pid = fork ())
     {
@@ -48,7 +53,11 @@ funny_core_dump P1H(void)
     default:		/* parent */
       while ((w = wait (&status)) != pid && w != -1)
 	;
+#ifdef HAVE_SYS_WAIT_H
+      if (WCOREDUMP(status))
+#else
       if (status.w_coredump)
+#endif
 	exit (0);
       (void) write (2, "attempt to dump core failed\n", 28);
       exit (1);
