correctly report timeout on select timeout

pull/2/merge
Qingping Hou 12 years ago
parent 414f8bec34
commit 01e8e5e820

@ -274,7 +274,9 @@ 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: timeout\n");
} else if (num < 0) {
return luaL_error(L, "Waiting for input failed: %d\n", errno);
}

Loading…
Cancel
Save