updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / ppp-alt / ppp-2.4.2-alt-killmypg.patch
blobb0c7251c7ac962b69c0fd84dd510c941329171b1
1 --- ppp-2.4.2/pppd/main.c.vns 2004-06-07 14:50:35 +0400
2 +++ ppp-2.4.2/pppd/main.c 2004-06-08 15:15:07 +0400
3 @@ -204,7 +204,6 @@
4 static void get_input __P((void));
5 static void calltimeout __P((void));
6 static struct timeval *timeleft __P((struct timeval *));
7 -static void kill_my_pg __P((int));
8 static void hup __P((int));
9 static void term __P((int));
10 static void chld __P((int));
11 @@ -1408,23 +1407,6 @@
15 - * kill_my_pg - send a signal to our process group, and ignore it ourselves.
16 - */
17 -static void
18 -kill_my_pg(sig)
19 - int sig;
21 - struct sigaction act, oldact;
23 - act.sa_handler = SIG_IGN;
24 - act.sa_flags = 0;
25 - sigaction(sig, &act, &oldact);
26 - kill(0, sig);
27 - sigaction(sig, &oldact, NULL);
31 -/*
32 * hup - Catch SIGHUP signal.
34 * Indicates that the physical layer has been disconnected.
35 @@ -1435,14 +1417,23 @@
36 hup(sig)
37 int sig;
39 + static ignore_next = 0;
40 + if(ignore_next)
41 + {
42 + ignore_next = 0;
43 + return;
44 + }
45 info("Hangup (SIGHUP)");
46 got_sighup = 1;
47 if (conn_running)
48 - /* Send the signal to the [dis]connector process(es) also */
49 - kill_my_pg(sig);
50 + {
51 + /* Send the signal to the [dis]connector process(es) also */
52 + ignore_next = 1;
53 + kill(0, sig);
54 + }
55 notify(sigreceived, sig);
56 if (waiting)
57 - siglongjmp(sigjmp, 1);
58 + siglongjmp(sigjmp, 1);
62 @@ -1456,14 +1447,23 @@
63 term(sig)
64 int sig;
66 + static ignore_next = 0;
67 + if(ignore_next)
68 + {
69 + ignore_next = 0;
70 + return;
71 + }
72 info("Terminating on signal %d.", sig);
73 got_sigterm = 1;
74 if (conn_running)
75 - /* Send the signal to the [dis]connector process(es) also */
76 - kill_my_pg(sig);
77 + {
78 + /* Send the signal to the [dis]connector process(es) also */
79 + ignore_next = 1;
80 + kill(0, sig);
81 + }
82 notify(sigreceived, sig);
83 if (waiting)
84 - siglongjmp(sigjmp, 1);
85 + siglongjmp(sigjmp, 1);
89 @@ -1523,14 +1523,23 @@
90 bad_signal(sig)
91 int sig;
93 + static ignore_next = 0;
94 static int crashed = 0;
96 + if(ignore_next)
97 + {
98 + ignore_next = 0;
99 + return;
101 if (crashed)
102 - _exit(127);
103 + _exit(127);
104 crashed = 1;
105 error("Fatal signal %d", sig);
106 if (conn_running)
107 - kill_my_pg(SIGTERM);
109 + ignore_next = 1;
110 + kill(0, SIGTERM);
112 notify(sigreceived, sig);
113 die(127);