moonbridge

changeset 285:a7395fb91ec3

Removed moonbridge_io.signals table
author jbe
date Sun Jun 11 00:04:05 2017 +0200 (2017-06-11)
parents 28aab22e68b6
children 26a16090276d
files moonbridge_io.c reference.txt
line diff
     1.1 --- a/moonbridge_io.c	Sun Jun 11 00:02:43 2017 +0200
     1.2 +++ b/moonbridge_io.c	Sun Jun 11 00:04:05 2017 +0200
     1.3 @@ -60,7 +60,6 @@
     1.4  #define MOONBR_IO_LISTENER_MT_REGKEY "moonbridge_io_listener"
     1.5  #define MOONBR_IO_CHILD_MT_REGKEY "moonbridge_io_child"
     1.6  #define MOONBR_IO_CHILD_PT_REGKEY "moonbridge_io_child_pt"
     1.7 -#define MOONBR_IO_SIGNALS_REGKEY "moonbridge_io_signals"
     1.8  
     1.9  #ifdef MOONBR_IO_USE_TLS
    1.10  
    1.11 @@ -1534,18 +1533,7 @@
    1.12    moonbr_io_child_t *child;
    1.13    int sig;
    1.14    child = luaL_checkudata(L, 1, MOONBR_IO_CHILD_MT_REGKEY);
    1.15 -  if (lua_type(L, 2) == LUA_TSTRING) {
    1.16 -    lua_getfield(L, LUA_REGISTRYINDEX, MOONBR_IO_SIGNALS_REGKEY);
    1.17 -    lua_pushvalue(L, 2);
    1.18 -    lua_gettable(L, -2);
    1.19 -    sig = lua_tointeger(L, -1);
    1.20 -    if (!sig) {
    1.21 -      lua_pushvalue(L, 2);
    1.22 -      luaL_error(L, "Unknown signal \"%s\"", lua_tostring(L, 2));
    1.23 -    }
    1.24 -  } else {
    1.25 -    sig = luaL_optinteger(L, 2, SIGKILL);
    1.26 -  }
    1.27 +  sig = luaL_optinteger(L, 2, SIGKILL);
    1.28    if (!child->pid) luaL_error(L, "Attempt to kill an already collected child process");
    1.29    if (kill(child->pid, sig)) {
    1.30      moonbr_io_prepare_errmsg();
    1.31 @@ -2092,26 +2080,6 @@
    1.32    moonbr_io_pushhandle(L, 2);
    1.33    lua_setfield(L, -2, "stderr");
    1.34  
    1.35 -  lua_newtable(L);  // signal numbers
    1.36 -  lua_pushinteger(L, SIGHUP);  lua_setfield(L, -2, "HUP");
    1.37 -  lua_pushinteger(L, SIGINT);  lua_setfield(L, -2, "INT");
    1.38 -  lua_pushinteger(L, SIGQUIT); lua_setfield(L, -2, "QUIT");
    1.39 -  lua_pushinteger(L, SIGABRT); lua_setfield(L, -2, "ABRT");
    1.40 -  lua_pushinteger(L, SIGPIPE); lua_setfield(L, -2, "PIPE");
    1.41 -  lua_pushinteger(L, SIGALRM); lua_setfield(L, -2, "ALRM");
    1.42 -  lua_pushinteger(L, SIGTERM); lua_setfield(L, -2, "TERM");
    1.43 -  lua_pushinteger(L, SIGTSTP); lua_setfield(L, -2, "TSTP");
    1.44 -  lua_pushinteger(L, SIGCONT); lua_setfield(L, -2, "CONT");
    1.45 -  lua_pushinteger(L, SIGVTALRM); lua_setfield(L, -2, "VTALRM");
    1.46 -#ifdef SIGINFO
    1.47 -  lua_pushinteger(L, SIGINFO); lua_setfield(L, -2, "INFO");
    1.48 -#endif
    1.49 -  lua_pushinteger(L, SIGUSR1); lua_setfield(L, -2, "USR1");
    1.50 -  lua_pushinteger(L, SIGUSR2); lua_setfield(L, -2, "USR2");
    1.51 -  lua_pushvalue(L, -1);
    1.52 -  lua_setfield(L, -3, "signals");
    1.53 -  lua_setfield(L, LUA_REGISTRYINDEX, MOONBR_IO_SIGNALS_REGKEY);
    1.54 -
    1.55    luaL_setfuncs(L, moonbr_io_module_funcs, 0);
    1.56    return 1;
    1.57  
     2.1 --- a/reference.txt	Sun Jun 11 00:02:43 2017 +0200
     2.2 +++ b/reference.txt	Sun Jun 11 00:04:05 2017 +0200
     2.3 @@ -396,12 +396,6 @@
     2.4  was received).
     2.5  
     2.6  
     2.7 -### moonbridge_io.signals
     2.8 -
     2.9 -A table mapping a string (e.g. "TERM" or "KILL") to the corresponding signal
    2.10 -number (e.g. 9 or 15, respectively).
    2.11 -
    2.12 -
    2.13  ### moonbridge_io.sigterm_received()
    2.14  
    2.15  Returns true if a SIGTERM was received after moonbridge_io.sigterm_setup() has

Impressum / About Us