From e9636f192a5c312424b7598ca182b0425827b08b Mon Sep 17 00:00:00 2001 From: Thierry Fournier Date: Thu, 8 Mar 2018 09:54:32 +0100 Subject: [PATCH] BUG/MINOR: lua: the function returns anything The output of these function indicates that one element is pushed in the stack, but no element is set in the stack. Actually, if anyone read the value returned by this function, is gets "something" present in the stack. This patch is a complement of these one: 119a5f10e47f3507e58116 The LuaSocket documentation tell anything about the returned value, but the effective code set an integer of value one. https://github.com/diegonehab/luasocket/blob/316a9455b9cb4637fe6e62b20fbe05f5141fec54/src/timeout.c#L172 Thanks to Tim for the bug report. This patch should be backported in all version from 1.6 --- src/hlua.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hlua.c b/src/hlua.c index aeb0e2d44b..3b87aa94f2 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2497,6 +2497,7 @@ __LJMP static int hlua_socket_settimeout(struct lua_State *L) s->res.wto = tmout; xref_unlock(&socket->xref, peer); + lua_pushinteger(L, 1); return 1; } -- 2.47.3