mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
sigign
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "skynet_imp.h"
|
||||
#include "skynet_env.h"
|
||||
#include "luacompat52.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -8,6 +9,7 @@
|
||||
#include <lua.h>
|
||||
#include <lualib.h>
|
||||
#include <lauxlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
static int
|
||||
optint(const char *key, int opt) {
|
||||
@@ -71,6 +73,13 @@ _init_env(lua_State *L) {
|
||||
lua_pop(L,1);
|
||||
}
|
||||
|
||||
int sigign() {
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sa, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[]) {
|
||||
const char * config_file = "config";
|
||||
@@ -79,6 +88,8 @@ main(int argc, char *argv[]) {
|
||||
}
|
||||
skynet_env_init();
|
||||
|
||||
sigign();
|
||||
|
||||
struct skynet_config config;
|
||||
|
||||
struct lua_State *L = luaL_newstate();
|
||||
|
||||
Reference in New Issue
Block a user