aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-10-09 00:27:18 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-10-09 00:27:18 -0500
commitce421bc17ce852f6a6f3951d3594d47047db07ca (patch)
tree0789ab0dd75b3aadb504d7c506c2ebd2292c9593
parent5d0380fd2fdc4ef21efab57c8645bc96f1e8ba8d (diff)
downloadluasignal-ce421bc17ce852f6a6f3951d3594d47047db07ca.tar.gz
luasignal-ce421bc17ce852f6a6f3951d3594d47047db07ca.zip
only use gL in signal handlers
-rw-r--r--src/signal.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/signal.c b/src/signal.c
index 640ae72..a52c4b4 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -63,23 +63,23 @@ static int l_signal(lua_State* L)
gL = L;
- signame = luaL_checklstring(gL, 1, NULL);
+ signame = luaL_checklstring(L, 1, NULL);
sig = name_to_sig(signame);
if (sig == -1) {
- lua_pushfstring(gL, "signal() called with invalid signal name: %s", signame);
- lua_error(gL);
+ lua_pushfstring(L, "signal() called with invalid signal name: %s", signame);
+ lua_error(L);
}
- if (lua_isfunction(gL, 2)) {
+ if (lua_isfunction(L, 2)) {
handler = signal_handler;
- lua_getfield(gL, LUA_REGISTRYINDEX, REG_TABLE);
- lua_pushvalue(gL, 2);
- lua_setfield(gL, -2, signame);
+ lua_getfield(L, LUA_REGISTRYINDEX, REG_TABLE);
+ lua_pushvalue(L, 2);
+ lua_setfield(L, -2, signame);
}
- else if (lua_isstring(gL, 2)) {
+ else if (lua_isstring(L, 2)) {
const char* pseudo_handler;
- pseudo_handler = lua_tostring(gL, 2);
+ pseudo_handler = lua_tostring(L, 2);
if (strcmp(pseudo_handler, "ignore") == 0) {
handler = SIG_IGN;
}
@@ -95,13 +95,13 @@ static int l_signal(lua_State* L)
}
}
else {
- lua_pushstring(gL, "Must pass a valid handler to signal()");
- lua_error(gL);
+ lua_pushstring(L, "Must pass a valid handler to signal()");
+ lua_error(L);
}
}
else {
- lua_pushstring(gL, "Must pass a handler to signal()");
- lua_error(gL);
+ lua_pushstring(L, "Must pass a handler to signal()");
+ lua_error(L);
}
sa.sa_handler = handler;
sigfillset(&sset);