Fixed amb110 - socket_change() returned 1 if select() syscall returned -1 (KoST)

This commit is contained in:
Scott Ehlert 2007-04-24 19:17:30 +00:00
parent 33e01af955
commit 5d6d0282b0

View File

@ -133,7 +133,7 @@ static cell AMX_NATIVE_CALL socket_change(AMX *amx, cell *params) /* 2 param */
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = timeout; tv.tv_usec = timeout;
// Now we "select", which will show us if new data is waiting in the socket's buffer // Now we "select", which will show us if new data is waiting in the socket's buffer
if (select(socket+1, &rfds, NULL, NULL, &tv)) if (select(socket+1, &rfds, NULL, NULL, &tv) > 0)
return 1; // Ok, new data, return it return 1; // Ok, new data, return it
else else
return 0; // No new data, return it return 0; // No new data, return it