-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
78 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef __SKYNET_DAEMON_H__ | ||
#define __SKYNET_DAEMON_H__ | ||
|
||
class Skynet_Daemon { | ||
|
||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "skynet_start.h" | ||
|
||
int Skynet_Start::SIG = 0; | ||
|
||
void Skynet_Start::start() { | ||
// register SIGHUP for log file reopen | ||
struct sigaction sa; | ||
sa.sa_handler = &handle_hup; | ||
sa.sa_flags = SA_RESTART; | ||
sigfillset(&sa.sa_mask); | ||
sigaction(SIGHUP, &sa, NULL); | ||
|
||
if (skynet_config->daemon.size()) { | ||
//if (daemon_init(config->daemon)) { | ||
//exit(1); | ||
//} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef __SKYNET_START_H__ | ||
#define __SKYNET_START_H__ | ||
|
||
#include <signal.h> | ||
#include "skynet_loadconf.h" | ||
|
||
#define skynet_config Singletion<Skynet_LoadConfig>::install().getConfig() | ||
|
||
class Skynet_Start { | ||
public: | ||
Skynet_Start() {} | ||
~Skynet_Start() {} | ||
|
||
void start(); | ||
|
||
private: | ||
static void handle_hup(int signal) { | ||
if (signal == SIGHUP) { | ||
SIG = 1; | ||
} | ||
} | ||
static int SIG; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters