Subject: pkg/21524: package graphics/swfdec fails to compile [with fix]
To: None <gnats-bugs@gnats.netbsd.org>
From: Rhialto <rhialto@azenomei.knuffel.net>
List: netbsd-bugs
Date: 05/10/2003 23:47:15
>Number:         21524
>Category:       pkg
>Synopsis:       package graphics/swfdec fails to compile [with fix]
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 10 21:48:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Rhialto
>Release:        NetBSD 1.6
>Organization:
>Environment:
System: NetBSD loelappie.falu.nl 1.6 NetBSD 1.6 (LOELAPPIE) #39: Tue Apr 22 01:19:02 CEST 2003 rhialto@loelappie.falu.nl:/usr/src/sys/arch/i386/compile/LOELAPPIE i386
Architecture: i386
Machine: i386
>Description:

	The package graphics/swfdec has a patch patch-ab that seems to
	attempt to make the file player/swf_play.c compile if the
	#define SA_SIGINFO does not exist. This is the case on NetBSD
	1.6 for instance (and all previous presumably).

	However it still uses the type siginfo_t which also does not
	exist, and field struct sigaction.sa_sigaction which has the
	same issue.

>How-To-Repeat:
	try to build graphics/swfdec on NetBSD 1.6.
>Fix:
	Replace patch-ab with the following:


--- player/swf_play.c.orig	Wed Feb  5 21:19:27 2003
+++ player/swf_play.c	Sat May 10 15:32:46 2003
@@ -15,6 +15,8 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/time.h>
+#include <signal.h>
+#include <errno.h>
 #include <time.h>
 #include <string.h>
 
@@ -72,6 +74,14 @@
 static gboolean render_idle(gpointer data);
 
 /* fault handling stuff */
+#ifndef SA_SIGINFO
+typedef struct {
+    int si_signo;
+    int si_errno;
+    int si_code;
+    void *si_addr;
+} siginfo_t;
+#endif
 void fault_handler(int signum, siginfo_t *si, void *misc);
 void fault_restore(void);
 void fault_setup(void);
@@ -539,6 +549,19 @@
 	_exit(0);
 }
 
+#ifndef SA_SIGINFO
+void si_handler(int sig, int code, struct sigcontext *scp)
+{
+	siginfo_t si;
+
+	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 +578,13 @@
 	struct sigaction action;
 
 	memset(&action,0,sizeof(action));
+#ifdef SA_SIGINFO
 	action.sa_sigaction = fault_handler;
 	action.sa_flags = SA_SIGINFO;
+#else
+	action.sa_handler = (void (*)(int))si_handler;
+	action.sa_flags = 0;
+#endif
 
 	sigaction(SIGSEGV, &action, NULL);
 	sigaction(SIGQUIT, &action, NULL);


-Olaf.
-- 
___ Olaf 'Rhialto' Seibert      -- The evil eye is caused by the black
\X/ rhialto/at/xs4all.nl        -- tongue - Tom Poes, "Het boze oog", 4456.
>Release-Note:
>Audit-Trail:
>Unformatted: