aboutsummaryrefslogtreecommitdiff
path: root/src/reg.c
diff options
context:
space:
mode:
authorame <[email protected]>2024-02-12 15:32:07 -0600
committerame <[email protected]>2024-02-12 15:32:07 -0600
commitd85b1d781655663ee52d180e0fb9abe7e476adf5 (patch)
tree56f4e10d97f62cf1d937038b2ad78f38f7d53a48 /src/reg.c
parenta49a8175e668db69760a3bc0a3c9e7a56351d111 (diff)
no clue what i changed
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);