X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util-src%2Fsignal.c;h=961d2d3e06acda484613a0ebdfc54a8f25625586;hb=b9b20aa3f85ac7d9c5a8b0cce21b5b490969ceaf;hp=e6853f62b5d1cdb7477825b6a464946f53c84685;hpb=be4f17b9cfe5cea5783cced2a737a44454f55778;p=prosody.git diff --git a/util-src/signal.c b/util-src/signal.c index e6853f62..961d2d3e 100644 --- a/util-src/signal.c +++ b/util-src/signal.c @@ -29,10 +29,6 @@ #include #include -#ifdef __unix__ -#include -#endif - #include "lua.h" #include "lauxlib.h" @@ -169,13 +165,13 @@ static struct signal_event *last_event = NULL; static void sighook(lua_State *L, lua_Debug *ar) { + struct signal_event *event; /* restore the old hook */ lua_sethook(L, Hsig, Hmask, Hcount); lua_pushstring(L, LUA_SIGNAL); lua_gettable(L, LUA_REGISTRYINDEX); - struct signal_event *event; while((event = signal_queue)) { lua_pushnumber(L, event->Nsig); @@ -330,7 +326,7 @@ static int l_raise(lua_State *L) return 1; } -#ifdef __unix__ +#if defined(__unix__) || defined(__APPLE__) /* define some posix only functions */ @@ -377,7 +373,7 @@ static int l_kill(lua_State *L) static const struct luaL_Reg lsignal_lib[] = { {"signal", l_signal}, {"raise", l_raise}, -#ifdef __unix__ +#if defined(__unix__) || defined(__APPLE__) {"kill", l_kill}, #endif {NULL, NULL}