$NetBSD: patch-ab,v 1.3 2003/05/12 20:17:48 jmc Exp $

--- player/swf_play.c.orig	Wed Feb  5 20:19:27 2003
+++ player/swf_play.c	Mon May 12 11:43:12 2003
@@ -15,6 +15,8 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/time.h>
+#include <sys/signal.h>
+#include <errno.h>
 #include <time.h>
 #include <string.h>
 
@@ -72,6 +74,15 @@
 static gboolean render_idle(gpointer data);
 
 /* fault handling stuff */
+#ifndef SI_USER
+typedef struct {
+        char *si_addr;
+        int si_signo;
+        int si_errno;
+        int si_code;
+} siginfo_t;
+#endif
+
 void fault_handler(int signum, siginfo_t *si, void *misc);
 void fault_restore(void);
 void fault_setup(void);
@@ -539,6 +550,20 @@
 	_exit(0);
 }
 
+#ifndef SI_USER
+void si_handler(int sig, int code, struct sigcontext *scp)
+{
+	siginfo_t si;
+
+	si.si_addr = NULL;
+	si.si_signo = sig;
+	si.si_errno = errno;
+	si.si_code = code;
+
+	fault_handler(sig, &si, scp);
+}
+#endif
+
 void fault_restore(void)
 {
 	struct sigaction action;
@@ -555,8 +580,13 @@
 	struct sigaction action;
 
 	memset(&action,0,sizeof(action));
+#ifdef SI_USER
 	action.sa_sigaction = fault_handler;
-	action.sa_flags = SA_SIGINFO;
+	action.sa_flags = 0;
+#else
+	action.sa_handler = (void (*)(int))si_handler;
+	action.sa_flags = 0;
+#endif
 
 	sigaction(SIGSEGV, &action, NULL);
 	sigaction(SIGQUIT, &action, NULL);
