# HG changeset patch # User jbe # Date 1497132245 -7200 # Node ID a7395fb91ec34ab0526ac59341bf463e86f2899f # Parent 28aab22e68b689511ce374ff88dc50d4548ea78c Removed moonbridge_io.signals table diff -r 28aab22e68b6 -r a7395fb91ec3 moonbridge_io.c --- a/moonbridge_io.c Sun Jun 11 00:02:43 2017 +0200 +++ b/moonbridge_io.c Sun Jun 11 00:04:05 2017 +0200 @@ -60,7 +60,6 @@ #define MOONBR_IO_LISTENER_MT_REGKEY "moonbridge_io_listener" #define MOONBR_IO_CHILD_MT_REGKEY "moonbridge_io_child" #define MOONBR_IO_CHILD_PT_REGKEY "moonbridge_io_child_pt" -#define MOONBR_IO_SIGNALS_REGKEY "moonbridge_io_signals" #ifdef MOONBR_IO_USE_TLS @@ -1534,18 +1533,7 @@ moonbr_io_child_t *child; int sig; child = luaL_checkudata(L, 1, MOONBR_IO_CHILD_MT_REGKEY); - if (lua_type(L, 2) == LUA_TSTRING) { - lua_getfield(L, LUA_REGISTRYINDEX, MOONBR_IO_SIGNALS_REGKEY); - lua_pushvalue(L, 2); - lua_gettable(L, -2); - sig = lua_tointeger(L, -1); - if (!sig) { - lua_pushvalue(L, 2); - luaL_error(L, "Unknown signal \"%s\"", lua_tostring(L, 2)); - } - } else { - sig = luaL_optinteger(L, 2, SIGKILL); - } + sig = luaL_optinteger(L, 2, SIGKILL); if (!child->pid) luaL_error(L, "Attempt to kill an already collected child process"); if (kill(child->pid, sig)) { moonbr_io_prepare_errmsg(); @@ -2092,26 +2080,6 @@ moonbr_io_pushhandle(L, 2); lua_setfield(L, -2, "stderr"); - lua_newtable(L); // signal numbers - lua_pushinteger(L, SIGHUP); lua_setfield(L, -2, "HUP"); - lua_pushinteger(L, SIGINT); lua_setfield(L, -2, "INT"); - lua_pushinteger(L, SIGQUIT); lua_setfield(L, -2, "QUIT"); - lua_pushinteger(L, SIGABRT); lua_setfield(L, -2, "ABRT"); - lua_pushinteger(L, SIGPIPE); lua_setfield(L, -2, "PIPE"); - lua_pushinteger(L, SIGALRM); lua_setfield(L, -2, "ALRM"); - lua_pushinteger(L, SIGTERM); lua_setfield(L, -2, "TERM"); - lua_pushinteger(L, SIGTSTP); lua_setfield(L, -2, "TSTP"); - lua_pushinteger(L, SIGCONT); lua_setfield(L, -2, "CONT"); - lua_pushinteger(L, SIGVTALRM); lua_setfield(L, -2, "VTALRM"); -#ifdef SIGINFO - lua_pushinteger(L, SIGINFO); lua_setfield(L, -2, "INFO"); -#endif - lua_pushinteger(L, SIGUSR1); lua_setfield(L, -2, "USR1"); - lua_pushinteger(L, SIGUSR2); lua_setfield(L, -2, "USR2"); - lua_pushvalue(L, -1); - lua_setfield(L, -3, "signals"); - lua_setfield(L, LUA_REGISTRYINDEX, MOONBR_IO_SIGNALS_REGKEY); - luaL_setfuncs(L, moonbr_io_module_funcs, 0); return 1; diff -r 28aab22e68b6 -r a7395fb91ec3 reference.txt --- a/reference.txt Sun Jun 11 00:02:43 2017 +0200 +++ b/reference.txt Sun Jun 11 00:04:05 2017 +0200 @@ -396,12 +396,6 @@ was received). -### moonbridge_io.signals - -A table mapping a string (e.g. "TERM" or "KILL") to the corresponding signal -number (e.g. 9 or 15, respectively). - - ### moonbridge_io.sigterm_received() Returns true if a SIGTERM was received after moonbridge_io.sigterm_setup() has