From 15b926d7a2aec0d261ef9d416481aed8dbf0b072 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 10 Jan 2010 03:54:29 +0000 Subject: util.signal: Restore the old debug hook earlier, just in case we receive another signal between clearing the signal queue and restoring it --- util-src/signal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util-src') diff --git a/util-src/signal.c b/util-src/signal.c index 68ef73de..53bbc4ed 100644 --- a/util-src/signal.c +++ b/util-src/signal.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) -- cgit v1.2.3