From 6e721a379e4f40783b20d6d675218bdede5b1101 Mon Sep 17 00:00:00 2001
From: Thierry Fournier <thierry.fournier@ozon.io>
Date: Thu, 8 Mar 2018 09:54:32 +0100
Subject: [PATCH 1/3] BUG/MINOR: lua: the function returns anything

The output of these function indicates that one element is pushed in
the stack, but it is not the case. Actually, if anyone read the value
returned by this function, is gets "something" present in the stack.

This patch should be backported in all version from 1.6
---
 src/hlua.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/hlua.c b/src/hlua.c
index ebe8c92..b54f091 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -11,6 +11,7 @@
  */
 
 #include <ctype.h>
+#include <limits.h>
 #include <setjmp.h>
 
 #include <lauxlib.h>
@@ -2497,7 +2498,7 @@ __LJMP static int hlua_socket_settimeout(struct lua_State *L)
 	s->res.wto = tmout;
 	xref_unlock(&socket->xref, peer);
 
-	return 1;
+	return 0;
 }
 
 __LJMP static int hlua_socket_new(lua_State *L)
-- 
2.10.1

