Software /
code /
prosody
Comparison
util-src/signal.c @ 3284:867d6413fe0a
util.signal: Moved a variable declaration to the top of a function, for ANSI C compliance.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 20 Jun 2010 04:07:55 +0500 |
parent | 3283:4a1a87254852 |
child | 6411:6c8f6364bc48 |
comparison
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); |