From f503e9c2df2799fd9ce108535581448eac6890e8 Mon Sep 17 00:00:00 2001 From: chrox Date: Sun, 25 Nov 2012 16:16:43 +0800 Subject: [PATCH] bugfix: waitForInput should return error when select returns zero --- input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input.c b/input.c index 245abd483..7d645abbb 100644 --- a/input.c +++ b/input.c @@ -274,7 +274,7 @@ static int waitForInput(lua_State *L) { * timeout at all. */ num = select(nfds, &fds, NULL, NULL, (usecs < 0) ? NULL : &timeout); - if(num < 0) { + if(num <= 0) { return luaL_error(L, "Waiting for input failed: %d\n", errno); }