mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
[bugfix] alpine linux 编译不通过。
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user