Removed
Link Here
|
1 |
--- finch/libgnt/gntmain.c.orig 2015-07-10 05:07:01.325805007 -0400 |
2 |
+++ finch/libgnt/gntmain.c 2015-07-10 13:05:46.746810688 -0400 |
3 |
@@ -407,10 +407,11 @@ raise: |
4 |
|
5 |
#ifdef SIGWINCH |
6 |
static void (*org_winch_handler)(int); |
7 |
+static void (*org_winch_handler_sa)(int, siginfo_t *, void *); |
8 |
#endif |
9 |
|
10 |
static void |
11 |
-sighandler(int sig) |
12 |
+sighandler(int sig, siginfo_t *info, void *data) |
13 |
{ |
14 |
switch (sig) { |
15 |
#ifdef SIGWINCH |
16 |
@@ -419,16 +420,15 @@ sighandler(int sig) |
17 |
g_idle_add((GSourceFunc)refresh_screen, NULL); |
18 |
if (org_winch_handler) |
19 |
org_winch_handler(sig); |
20 |
- signal(SIGWINCH, sighandler); |
21 |
+ if (org_winch_handler_sa) |
22 |
+ org_winch_handler_sa(sig, info, data); |
23 |
break; |
24 |
#endif |
25 |
case SIGCHLD: |
26 |
clean_pid(); |
27 |
- signal(SIGCHLD, sighandler); |
28 |
break; |
29 |
case SIGINT: |
30 |
ask_before_exit(); |
31 |
- signal(SIGINT, sighandler); |
32 |
break; |
33 |
} |
34 |
} |
35 |
@@ -456,6 +456,10 @@ void gnt_init() |
36 |
{ |
37 |
char *filename; |
38 |
const char *locale; |
39 |
+ struct sigaction act; |
40 |
+#ifdef SIGWINCH |
41 |
+ struct sigaction oact; |
42 |
+#endif |
43 |
|
44 |
if (channel) |
45 |
return; |
46 |
@@ -501,11 +505,25 @@ void gnt_init() |
47 |
werase(stdscr); |
48 |
wrefresh(stdscr); |
49 |
|
50 |
+ act.sa_sigaction = sighandler; |
51 |
+ sigemptyset(&act.sa_mask); |
52 |
+ act.sa_flags = SA_SIGINFO; |
53 |
+ |
54 |
#ifdef SIGWINCH |
55 |
- org_winch_handler = signal(SIGWINCH, sighandler); |
56 |
+ org_winch_handler = NULL; |
57 |
+ org_winch_handler_sa = NULL; |
58 |
+ sigaction(SIGWINCH, &act, &oact); |
59 |
+ if (oact.sa_flags & SA_SIGINFO) |
60 |
+ { |
61 |
+ org_winch_handler_sa = oact.sa_sigaction; |
62 |
+ } |
63 |
+ else if (oact.sa_handler != SIG_DFL && oact.sa_handler != SIG_IGN) |
64 |
+ { |
65 |
+ org_winch_handler = oact.sa_handler; |
66 |
+ } |
67 |
#endif |
68 |
- signal(SIGCHLD, sighandler); |
69 |
- signal(SIGINT, sighandler); |
70 |
+ sigaction(SIGCHLD, &act, NULL); |
71 |
+ sigaction(SIGINT, &act, NULL); |
72 |
signal(SIGPIPE, SIG_IGN); |
73 |
|
74 |
#if !GLIB_CHECK_VERSION(2, 36, 0) |