Merge pull request #639 from chrox/waitforinput-fix

bugfix: waitForInput should return error when select returns zero
pull/2/merge
{Qingping,Dave} Hou 12 years ago
commit 5206ba9790

@ -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);
}

Loading…
Cancel
Save