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
|
--- tools/gst-launch.c.orig 2003-02-02 01:05:42.000000000 +0100
+++ tools/gst-launch.c 2003-05-13 00:24:19.000000000 +0200
@@ -1,7 +1,9 @@
+#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#include <sys/wait.h>
+#include <sys/signal.h>
#include <gst/gst.h>
static guint64 iterations = 0;
@@ -10,6 +12,15 @@
static guint64 max = 0;
static GstClock *s_clock;
+#ifndef SI_USER
+typedef struct {
+ char *si_addr;
+ int si_signo;
+ int si_errno;
+ int si_code;
+} siginfo_t;
+#endif
+
gboolean
idle_func (gpointer data)
{
@@ -158,6 +169,20 @@
}
+#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
+
static void
fault_restore (void)
{
@@ -176,8 +201,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);
|