Skip to content

Commit

Permalink
native: Fix socket timeout handling for blocking reads on Linux
Browse files Browse the repository at this point in the history
This was a bug introduced earlier in development of 2.10.0
  • Loading branch information
kohlschuetter committed Jun 28, 2024
1 parent 0421228 commit 80c0774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion junixsocket-native/src/main/c/receive.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ JNIEXPORT jint JNICALL Java_org_newsclub_net_unix_NativeUnixSocket_read(
jint returnValue;
if(count < 0) {
// read(2) returns -1 on error. Java throws an Exception.
if(errno == EWOULDBLOCK) {
if(errno == EWOULDBLOCK && checkNonBlocking(handle, socket_errno)) {
returnValue = -2;
} else {
_throwErrnumException(env, errno, fd);
Expand Down

0 comments on commit 80c0774

Please sign in to comment.