Lines 134-140
Link Here
|
134 |
|
134 |
|
135 |
char *progname; /* Name of this program */ |
135 |
char *progname; /* Name of this program */ |
136 |
char hostname[MAXNAMELEN]; /* Our hostname */ |
136 |
char hostname[MAXNAMELEN]; /* Our hostname */ |
137 |
static char pidfilename[MAXPATHLEN]; /* name of pid file */ |
137 |
char pidfilename[MAXPATHLEN]; /* name of pid file */ |
138 |
static char linkpidfile[MAXPATHLEN]; /* name of linkname pid file */ |
138 |
static char linkpidfile[MAXPATHLEN]; /* name of linkname pid file */ |
139 |
char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */ |
139 |
char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */ |
140 |
uid_t uid; /* Our real user-id */ |
140 |
uid_t uid; /* Our real user-id */ |
Lines 244-249
Link Here
|
244 |
static void toggle_debug __P((int)); |
244 |
static void toggle_debug __P((int)); |
245 |
static void open_ccp __P((int)); |
245 |
static void open_ccp __P((int)); |
246 |
static void bad_signal __P((int)); |
246 |
static void bad_signal __P((int)); |
|
|
247 |
static void remove_pidfilenames __P((void)); |
247 |
static void holdoff_end __P((void *)); |
248 |
static void holdoff_end __P((void *)); |
248 |
static void forget_child __P((int pid, int status)); |
249 |
static void forget_child __P((int pid, int status)); |
249 |
static int reap_kids __P((void)); |
250 |
static int reap_kids __P((void)); |
Lines 846-861
Link Here
|
846 |
} |
847 |
} |
847 |
|
848 |
|
848 |
/* |
849 |
/* |
849 |
* remove_pidfile - remove our pid files |
850 |
* remove_pidfile - remove one of the 2 pidfiles (pidfilename or linkpidfile) |
850 |
*/ |
851 |
*/ |
851 |
void remove_pidfiles() |
852 |
void |
|
|
853 |
remove_pidfile(filename) |
854 |
char* filename; |
852 |
{ |
855 |
{ |
853 |
if (pidfilename[0] != 0 && unlink(pidfilename) < 0 && errno != ENOENT) |
856 |
if (filename[0] != 0 && unlink(filename) < 0 && errno != ENOENT) |
854 |
warn("unable to delete pid file %s: %m", pidfilename); |
857 |
warn("unable to delete pid file %s: %m", filename); |
855 |
pidfilename[0] = 0; |
858 |
filename[0] = 0; |
856 |
if (linkpidfile[0] != 0 && unlink(linkpidfile) < 0 && errno != ENOENT) |
859 |
} |
857 |
warn("unable to delete pid file %s: %m", linkpidfile); |
860 |
|
858 |
linkpidfile[0] = 0; |
861 |
/* |
|
|
862 |
* remove_pidfiles - remove our pid files |
863 |
*/ |
864 |
static void remove_pidfiles() |
865 |
{ |
866 |
remove_pidfile(pidfilename); |
867 |
remove_pidfile(linkpidfile); |
859 |
} |
868 |
} |
860 |
|
869 |
|
861 |
/* |
870 |
/* |