diff options
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);
|
