1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
$NetBSD: patch-ab,v 1.2 2003/05/11 10:05:13 jmc Exp $
--- player/swf_play.c.orig Wed Feb 5 20:19:27 2003
+++ player/swf_play.c Sun May 11 04:39:15 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 SA_SIGINFO
+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 SA_SIGINFO
+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 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);
|