Contents of /trunk/ppp/patches/ppp-2.4.4-linkpidfile.patch
Parent Directory | Revision Log
Revision 797 -
(show annotations)
(download)
Mon May 11 09:46:04 2009 UTC (15 years, 4 months ago) by niro
File size: 3430 byte(s)
Mon May 11 09:46:04 2009 UTC (15 years, 4 months ago) by niro
File size: 3430 byte(s)
-added patches from gentoo
1 | diff -Nru ppp-2.4.4.orig/pppd/auth.c ppp-2.4.4/pppd/auth.c |
2 | --- ppp-2.4.4.orig/pppd/auth.c 2007-05-28 21:08:06.000000000 +0300 |
3 | +++ ppp-2.4.4/pppd/auth.c 2007-05-28 21:06:56.000000000 +0300 |
4 | @@ -648,7 +648,7 @@ |
5 | * we delete its pid file. |
6 | */ |
7 | if (!doing_multilink && !demand) |
8 | - remove_pidfiles(); |
9 | + remove_pidfile(pidfilename); |
10 | |
11 | /* |
12 | * If we may want to bring the link up again, transfer |
13 | diff -Nru ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c |
14 | --- ppp-2.4.4.orig/pppd/main.c 2007-05-28 21:08:06.000000000 +0300 |
15 | +++ ppp-2.4.4/pppd/main.c 2007-05-28 21:09:37.000000000 +0300 |
16 | @@ -134,7 +134,7 @@ |
17 | |
18 | char *progname; /* Name of this program */ |
19 | char hostname[MAXNAMELEN]; /* Our hostname */ |
20 | -static char pidfilename[MAXPATHLEN]; /* name of pid file */ |
21 | +char pidfilename[MAXPATHLEN]; /* name of pid file */ |
22 | static char linkpidfile[MAXPATHLEN]; /* name of linkname pid file */ |
23 | char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */ |
24 | uid_t uid; /* Our real user-id */ |
25 | @@ -244,6 +244,7 @@ |
26 | static void toggle_debug __P((int)); |
27 | static void open_ccp __P((int)); |
28 | static void bad_signal __P((int)); |
29 | +static void remove_pidfilenames __P((void)); |
30 | static void holdoff_end __P((void *)); |
31 | static void forget_child __P((int pid, int status)); |
32 | static int reap_kids __P((void)); |
33 | @@ -846,16 +847,24 @@ |
34 | } |
35 | |
36 | /* |
37 | - * remove_pidfile - remove our pid files |
38 | + * remove_pidfile - remove one of the 2 pidfiles (pidfilename or linkpidfile) |
39 | */ |
40 | -void remove_pidfiles() |
41 | +void |
42 | +remove_pidfile(filename) |
43 | + char* filename; |
44 | { |
45 | - if (pidfilename[0] != 0 && unlink(pidfilename) < 0 && errno != ENOENT) |
46 | - warn("unable to delete pid file %s: %m", pidfilename); |
47 | - pidfilename[0] = 0; |
48 | - if (linkpidfile[0] != 0 && unlink(linkpidfile) < 0 && errno != ENOENT) |
49 | - warn("unable to delete pid file %s: %m", linkpidfile); |
50 | - linkpidfile[0] = 0; |
51 | + if (filename[0] != 0 && unlink(filename) < 0 && errno != ENOENT) |
52 | + warn("unable to delete pid file %s: %m", filename); |
53 | + filename[0] = 0; |
54 | +} |
55 | + |
56 | +/* |
57 | + * remove_pidfiles - remove our pid files |
58 | + */ |
59 | +static void remove_pidfiles() |
60 | +{ |
61 | + remove_pidfile(pidfilename); |
62 | + remove_pidfile(linkpidfile); |
63 | } |
64 | |
65 | /* |
66 | diff -Nru ppp-2.4.4.orig/pppd/multilink.c ppp-2.4.4/pppd/multilink.c |
67 | --- ppp-2.4.4.orig/pppd/multilink.c 2007-05-28 21:08:06.000000000 +0300 |
68 | +++ ppp-2.4.4/pppd/multilink.c 2007-05-28 21:06:56.000000000 +0300 |
69 | @@ -267,7 +267,7 @@ |
70 | notice("Connection terminated."); |
71 | print_link_stats(); |
72 | if (!demand) { |
73 | - remove_pidfiles(); |
74 | + remove_pidfile(pidfilename); |
75 | script_unsetenv("IFNAME"); |
76 | } |
77 | |
78 | diff -Nru ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h |
79 | --- ppp-2.4.4.orig/pppd/pppd.h 2007-05-28 21:08:06.000000000 +0300 |
80 | +++ ppp-2.4.4/pppd/pppd.h 2007-05-28 21:10:11.000000000 +0300 |
81 | @@ -214,6 +214,7 @@ |
82 | extern int ifunit; /* Interface unit number */ |
83 | extern char ifname[]; /* Interface name */ |
84 | extern char hostname[]; /* Our hostname */ |
85 | +extern char pidfilename[]; /* name of pid file */ |
86 | extern u_char outpacket_buf[]; /* Buffer for outgoing packets */ |
87 | extern int devfd; /* fd of underlying device */ |
88 | extern int fd_ppp; /* fd for talking PPP */ |
89 | @@ -499,7 +500,7 @@ |
90 | int ppp_send_config __P((int, int, u_int32_t, int, int)); |
91 | int ppp_recv_config __P((int, int, u_int32_t, int, int)); |
92 | const char *protocol_name __P((int)); |
93 | -void remove_pidfiles __P((void)); |
94 | +void remove_pidfile __P((char *)); |
95 | void lock_db __P((void)); |
96 | void unlock_db __P((void)); |
97 |