aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/luaevent.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/luaevent.c b/src/luaevent.c
index a8d5f7d..19fb7d6 100644
--- a/src/luaevent.c
+++ b/src/luaevent.c
@@ -91,19 +91,21 @@ static int luaevent_addevent(lua_State* L) {
}
static int luaevent_loop(lua_State* L) {
+ int ret;
le_base *base = event_base_get(L, 1);
base->loop_L = L;
- int ret = event_base_loop(base->base, 0);
+ ret = event_base_loop(base->base, 0);
lua_pushinteger(L, ret);
return 1;
}
static int luaevent_loopexit(lua_State*L) {
+ int ret;
le_base *base = event_base_get(L, 1);
struct timeval tv = { 0, 0 };
if(lua_gettop(L) >= 2) /* Optional timeout before exiting the loop */
load_timeval(luaL_checknumber(L, 2), &tv);
- int ret = event_base_loopexit(base->base, &tv);
+ ret = event_base_loopexit(base->base, &tv);
lua_pushinteger(L, ret);
return 1;
}