diff -Nru ppp-2.4.4.orig/pppd/auth.c ppp-2.4.4/pppd/auth.c --- ppp-2.4.4.orig/pppd/auth.c 2007-05-28 21:08:06.000000000 +0300 +++ ppp-2.4.4/pppd/auth.c 2007-05-28 21:06:56.000000000 +0300 @@ -648,7 +648,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 diff -Nru ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c --- ppp-2.4.4.orig/pppd/main.c 2007-05-28 21:08:06.000000000 +0300 +++ ppp-2.4.4/pppd/main.c 2007-05-28 21:09:37.000000000 +0300 @@ -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 */ @@ -244,6 +244,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)); @@ -846,16 +847,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); } /* diff -Nru ppp-2.4.4.orig/pppd/multilink.c ppp-2.4.4/pppd/multilink.c --- ppp-2.4.4.orig/pppd/multilink.c 2007-05-28 21:08:06.000000000 +0300 +++ ppp-2.4.4/pppd/multilink.c 2007-05-28 21:06:56.000000000 +0300 @@ -267,7 +267,7 @@ notice("Connection terminated."); print_link_stats(); if (!demand) { - remove_pidfiles(); + remove_pidfile(pidfilename); script_unsetenv("IFNAME"); } diff -Nru ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h --- ppp-2.4.4.orig/pppd/pppd.h 2007-05-28 21:08:06.000000000 +0300 +++ ppp-2.4.4/pppd/pppd.h 2007-05-28 21:10:11.000000000 +0300 @@ -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 */ @@ -499,7 +500,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));