mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
Merge branch 'dev' of github.com:cloudwu/skynet into dev
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "skynet_daemon.h"
|
#include "skynet_daemon.h"
|
||||||
|
|
||||||
@@ -72,10 +73,14 @@ daemon_init(const char *pidfile) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
fprintf(stderr, "'daemon' is deprecated: first deprecated in OS X 10.5 , use launchd instead.\n");
|
||||||
|
#else
|
||||||
if (daemon(1,0)) {
|
if (daemon(1,0)) {
|
||||||
fprintf(stderr, "Can't daemonize.\n");
|
fprintf(stderr, "Can't daemonize.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
pid = write_pid(pidfile);
|
pid = write_pid(pidfile);
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user