diff options
| author | ame <[email protected]> | 2024-02-12 15:32:07 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-02-12 15:32:07 -0600 |
| commit | d85b1d781655663ee52d180e0fb9abe7e476adf5 (patch) | |
| tree | 56f4e10d97f62cf1d937038b2ad78f38f7d53a48 /src/reg.c | |
| parent | a49a8175e668db69760a3bc0a3c9e7a56351d111 (diff) | |
no clue what i changed
Diffstat (limited to 'src/reg.c')
| -rw-r--r-- | src/reg.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -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);
|
