diff --git a/skynet-src/skynet_daemon.c b/skynet-src/skynet_daemon.c index 4c5e3882..4b6b96e1 100644 --- a/skynet-src/skynet_daemon.c +++ b/skynet-src/skynet_daemon.c @@ -5,6 +5,7 @@ #include #include #include +#include #include "skynet_daemon.h" @@ -27,7 +28,7 @@ check_pid(const char *pidfile) { return pid; } -static int +static int write_pid(const char *pidfile) { FILE *f; int pid = 0; @@ -52,7 +53,7 @@ write_pid(const char *pidfile) { } return 0; } - + pid = getpid(); if (!fprintf(f,"%d\n", pid)) { fprintf(stderr, "Can't write pid.\n"); @@ -90,7 +91,7 @@ daemon_init(const char *pidfile) { return 0; } -int +int daemon_exit(const char *pidfile) { return unlink(pidfile); }