Skip to content

Commit 8f2515f

Browse files
committed
Fixed handling of zero timeout in native select()
1 parent db9d1f6 commit 8f2515f

File tree

1 file changed

+1
-1
lines changed
  • graalpython/com.oracle.graal.python.cext/posix

1 file changed

+1
-1
lines changed

graalpython/com.oracle.graal.python.cext/posix/posix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ int32_t call_select(int32_t nfds, int32_t* readfds, int32_t readfdsLen,
199199

200200
struct timeval timeout = {timeoutSec, timeoutUsec};
201201

202-
int result = select(nfds, &readfdsSet, &writefdsSet, &errfdsSet, timeoutSec > 0 ? &timeout : NULL);
202+
int result = select(nfds, &readfdsSet, &writefdsSet, &errfdsSet, timeoutSec >= 0 ? &timeout : NULL);
203203

204204
// fill in the output parameter
205205
fill_select_result(readfds, readfdsLen, &readfdsSet, selected, 0);

0 commit comments

Comments
 (0)