Lines 76-82
Link Here
|
76 |
static void my_daemon(int argc, char **argv); |
76 |
static void my_daemon(int argc, char **argv); |
77 |
#endif |
77 |
#endif |
78 |
|
78 |
|
79 |
static void log_pid(); |
79 |
static void log_pid(char *pid_file); |
80 |
static char *lookup(char *); |
80 |
static char *lookup(char *); |
81 |
|
81 |
|
82 |
static void showusage(char *prog) |
82 |
static void showusage(char *prog) |
Lines 347-362
Link Here
|
347 |
ledman_cmd(LEDMAN_CMD_ON, LEDMAN_VPN); |
347 |
ledman_cmd(LEDMAN_CMD_ON, LEDMAN_VPN); |
348 |
#endif |
348 |
#endif |
349 |
/* after we have our final pid... */ |
349 |
/* after we have our final pid... */ |
350 |
log_pid(); |
350 |
log_pid(pid_file); |
351 |
|
351 |
|
352 |
pptp_manager(argc, argv); |
352 |
pptp_manager(argc, argv); |
353 |
return 1; |
353 |
return 1; |
354 |
} |
354 |
} |
355 |
|
355 |
|
356 |
static void log_pid() { |
356 |
static void log_pid(char *pid_file) { |
357 |
FILE *f; |
357 |
FILE *f; |
358 |
pid_t pid; |
358 |
pid_t pid; |
359 |
char *pidfile = "/var/run/pptpd.pid"; |
359 |
char *pidfile = pid_file ? pid_file : "/var/run/pptpd.pid"; |
360 |
|
360 |
|
361 |
pid = getpid(); |
361 |
pid = getpid(); |
362 |
if ((f = fopen(pidfile, "w")) == NULL) { |
362 |
if ((f = fopen(pidfile, "w")) == NULL) { |