summaryrefslogtreecommitdiff
path: root/user/ppp/12_all_linkpidfile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/ppp/12_all_linkpidfile.patch')
-rw-r--r--user/ppp/12_all_linkpidfile.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/user/ppp/12_all_linkpidfile.patch b/user/ppp/12_all_linkpidfile.patch
new file mode 100644
index 000000000..9c5769c8f
--- /dev/null
+++ b/user/ppp/12_all_linkpidfile.patch
@@ -0,0 +1,93 @@
+--- ppp-2.4.5/pppd/auth.c
++++ ppp-2.4.5/pppd/auth.c
+@@ -637,7 +637,7 @@
+ * we delete its pid file.
+ */
+ if (!doing_multilink && !demand)
+- remove_pidfiles();
++ remove_pidfile(pidfilename);
+
+ /*
+ * If we may want to bring the link up again, transfer
+--- ppp-2.4.5/pppd/main.c
++++ ppp-2.4.5/pppd/main.c
+@@ -134,7 +134,7 @@
+
+ char *progname; /* Name of this program */
+ char hostname[MAXNAMELEN]; /* Our hostname */
+-static char pidfilename[MAXPATHLEN]; /* name of pid file */
++char pidfilename[MAXPATHLEN]; /* name of pid file */
+ static char linkpidfile[MAXPATHLEN]; /* name of linkname pid file */
+ char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */
+ uid_t uid; /* Our real user-id */
+@@ -245,6 +245,7 @@
+ static void toggle_debug __P((int));
+ static void open_ccp __P((int));
+ static void bad_signal __P((int));
++static void remove_pidfilenames __P((void));
+ static void holdoff_end __P((void *));
+ static void forget_child __P((int pid, int status));
+ static int reap_kids __P((void));
+@@ -835,16 +836,24 @@
+ }
+
+ /*
+- * remove_pidfile - remove our pid files
++ * remove_pidfile - remove one of the 2 pidfiles (pidfilename or linkpidfile)
+ */
+-void remove_pidfiles()
++void
++remove_pidfile(filename)
++ char* filename;
+ {
+- if (pidfilename[0] != 0 && unlink(pidfilename) < 0 && errno != ENOENT)
+- warn("unable to delete pid file %s: %m", pidfilename);
+- pidfilename[0] = 0;
+- if (linkpidfile[0] != 0 && unlink(linkpidfile) < 0 && errno != ENOENT)
+- warn("unable to delete pid file %s: %m", linkpidfile);
+- linkpidfile[0] = 0;
++ if (filename[0] != 0 && unlink(filename) < 0 && errno != ENOENT)
++ warn("unable to delete pid file %s: %m", filename);
++ filename[0] = 0;
++}
++
++/*
++ * remove_pidfiles - remove our pid files
++ */
++static void remove_pidfiles()
++{
++ remove_pidfile(pidfilename);
++ remove_pidfile(linkpidfile);
+ }
+
+ /*
+--- ppp-2.4.5/pppd/multilink.c
++++ ppp-2.4.5/pppd/multilink.c
+@@ -267,7 +267,7 @@
+ notice("Connection terminated.");
+ print_link_stats();
+ if (!demand) {
+- remove_pidfiles();
++ remove_pidfile(pidfilename);
+ script_unsetenv("IFNAME");
+ }
+
+--- ppp-2.4.5/pppd/pppd.h
++++ ppp-2.4.5/pppd/pppd.h
+@@ -214,6 +214,7 @@
+ extern int ifunit; /* Interface unit number */
+ extern char ifname[]; /* Interface name */
+ extern char hostname[]; /* Our hostname */
++extern char pidfilename[]; /* name of pid file */
+ extern u_char outpacket_buf[]; /* Buffer for outgoing packets */
+ extern int devfd; /* fd of underlying device */
+ extern int fd_ppp; /* fd for talking PPP */
+@@ -497,7 +498,7 @@
+ int ppp_send_config __P((int, int, u_int32_t, int, int));
+ int ppp_recv_config __P((int, int, u_int32_t, int, int));
+ const char *protocol_name __P((int));
+-void remove_pidfiles __P((void));
++void remove_pidfile __P((char *));
+ void lock_db __P((void));
+ void unlock_db __P((void));
+