util-src/signal.c

changeset 3284
867d6413fe0a
parent 3283
4a1a87254852
equal deleted inserted replaced
3283:4a1a87254852 3284:867d6413fe0a
163 163
164 static struct signal_event *last_event = NULL; 164 static struct signal_event *last_event = NULL;
165 165
166 static void sighook(lua_State *L, lua_Debug *ar) 166 static void sighook(lua_State *L, lua_Debug *ar)
167 { 167 {
168 struct signal_event *event;
168 /* restore the old hook */ 169 /* restore the old hook */
169 lua_sethook(L, Hsig, Hmask, Hcount); 170 lua_sethook(L, Hsig, Hmask, Hcount);
170 171
171 lua_pushstring(L, LUA_SIGNAL); 172 lua_pushstring(L, LUA_SIGNAL);
172 lua_gettable(L, LUA_REGISTRYINDEX); 173 lua_gettable(L, LUA_REGISTRYINDEX);
173 174
174 struct signal_event *event;
175 while((event = signal_queue)) 175 while((event = signal_queue))
176 { 176 {
177 lua_pushnumber(L, event->Nsig); 177 lua_pushnumber(L, event->Nsig);
178 lua_gettable(L, -2); 178 lua_gettable(L, -2);
179 lua_call(L, 0, 0); 179 lua_call(L, 0, 0);

mercurial