aboutsummaryrefslogtreecommitdiff
path: root/src/reg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reg.c')
-rw-r--r--src/reg.c21
1 files changed, 11 insertions, 10 deletions
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 <signal.h>
+#include <stdlib.h>
-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 <lib>.array functions
lua_newtable(L);