Contents of /trunk/ppp/patches/ppp-2.4.5-kill-pg-reworked.patch
Parent Directory | Revision Log
Revision 1108 -
(show annotations)
(download)
Fri Aug 20 11:00:04 2010 UTC (14 years, 2 months ago) by niro
File size: 1225 byte(s)
Fri Aug 20 11:00:04 2010 UTC (14 years, 2 months ago) by niro
File size: 1225 byte(s)
-reworked patch so that umtsmon does not break
1 | diff -Naur ppp-2.4.5/pppd/main.c ppp-2.4.5-magellan/pppd/main.c |
2 | --- ppp-2.4.5/pppd/main.c 2009-11-16 23:26:07.000000000 +0100 |
3 | +++ ppp-2.4.5-magellan/pppd/main.c 2010-08-20 12:36:00.000000000 +0200 |
4 | @@ -144,7 +144,7 @@ |
5 | int hungup; /* terminal has been hung up */ |
6 | int privileged; /* we're running as real uid root */ |
7 | int need_holdoff; /* need holdoff period before restarting */ |
8 | -int detached; /* have detached from terminal */ |
9 | +int detached = 0; /* have detached from terminal */ |
10 | volatile int status; /* exit status for pppd */ |
11 | int unsuccess; /* # unsuccessful connection attempts */ |
12 | int do_callback; /* != 0 if we should do callback next */ |
13 | @@ -1402,7 +1402,14 @@ |
14 | sigemptyset(&act.sa_mask); /* unnecessary in fact */ |
15 | act.sa_handler = SIG_IGN; |
16 | act.sa_flags = 0; |
17 | - kill(0, sig); |
18 | + if (detached) |
19 | + kill(0, sig); |
20 | + else { |
21 | + struct subprocess *chp; |
22 | + /* process group wasn't created (yet), kill all children instead */ |
23 | + for (chp = children; chp != NULL; chp = chp->next) |
24 | + kill(chp->pid, sig); |
25 | + } |
26 | /* |
27 | * The kill() above made the signal pending for us, as well as |
28 | * the rest of our process group, but we don't want it delivered |