diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-01-10 03:54:29 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-01-10 03:54:29 +0000 |
commit | 2aab3bf617feb6d3ba4508b0c505ffaaf117f28c (patch) | |
tree | 8a843931d0755f1c8f7152cede0e21a68c2e1dc8 /util-src | |
parent | 45db3bf84a5855b2b5cdad5ee8ec584103796a7a (diff) | |
download | prosody-2aab3bf617feb6d3ba4508b0c505ffaaf117f28c.tar.gz prosody-2aab3bf617feb6d3ba4508b0c505ffaaf117f28c.zip |
util.signal: Restore the old debug hook earlier, just in case we receive another signal between clearing the signal queue and restoring it
Diffstat (limited to 'util-src')
-rw-r--r-- | util-src/lsignal.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util-src/lsignal.c b/util-src/lsignal.c index 78c74d15..b6a36e25 100644 --- a/util-src/lsignal.c +++ b/util-src/lsignal.c @@ -165,6 +165,9 @@ static struct signal_event *last_event = NULL; static void sighook(lua_State *L, lua_Debug *ar) { + /* restore the old hook */ + lua_sethook(L, Hsig, Hmask, Hcount); + lua_pushstring(L, LUA_SIGNAL); lua_gettable(L, LUA_REGISTRYINDEX); @@ -180,8 +183,6 @@ static void sighook(lua_State *L, lua_Debug *ar) lua_pop(L, 1); /* pop lua_signal table */ - /* restore the old hook */ - lua_sethook(L, Hsig, Hmask, Hcount); } static void handle(int sig) |