From d85b1d781655663ee52d180e0fb9abe7e476adf5 Mon Sep 17 00:00:00 2001 From: ame Date: Mon, 12 Feb 2024 15:32:07 -0600 Subject: no clue what i changed --- src/reg.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/reg.c') diff --git a/src/reg.c b/src/reg.c index 38d5ee9..a364813 100644 --- a/src/reg.c +++ b/src/reg.c @@ -6,21 +6,22 @@ #include "math.h" #include "net.h" #include +#include -static int lua_exit(lua_State* L){ - printf("hi\n"); - return 0; +void sigHandle(int s){ + //signal(s, SIG_IGN); + + //signal(s, sigHandle); + exit(s); } -void sigHandle(int s){ - signal(s, SIG_IGN); - printf("meow\n"); - signal(s, sigHandle); +static int lua_exit(lua_State* L){ + + sigHandle(0); + return 0; } int luaopen_llib(lua_State* L) { - /* - lua_newuserdata(L, sizeof(void*)); luaL_newmetatable(L, "gc"); lua_pushstring(L, "__gc"); @@ -31,7 +32,7 @@ int luaopen_llib(lua_State* L) { lua_setfield(L, LUA_REGISTRYINDEX, "grr"); signal(SIGTERM, sigHandle); signal(SIGINT, sigHandle); -*/ + //create .array functions lua_newtable(L); -- cgit v1.2.3