Closed LoveMHz closed 4 months ago
GNU defines
EAGAIN
andEWOULDBLOCK
as the same value but notes both values should be checked for portability.This resolves a
Read from socket failed
issue introduced when building with non-GNU environments that define EAGAIN and EWOULDBLOCK as separate, distinct values.As noted in the GNU libc documentation under 2.2 Error Codes.
Portability Note: In many older Unix systems, this condition was indicated by
EWOULDBLOCK
, which was a distinct error code different fromEAGAIN
. To make your program portable, you should check for both codes and treat them the same.This patch corrects the check in
smb2_read_data
that could fail under aread_more_data
goto and a socket read that returnsEWOULDBLOCK
.Similar checks already appear in the
libsmb2
codebase.https://github.com/sahlberg/libsmb2/blob/c88fe13cb7a3b67cc93db852c385c89c539a0016/lib/socket.c#L277
GNU defines
EAGAIN
andEWOULDBLOCK
as the same value but notes both values should be checked for portability.This resolves a
Read from socket failed
issue introduced when building with non-GNU environments that define EAGAIN and EWOULDBLOCK as separate, distinct values.As noted in the GNU libc documentation under 2.2 Error Codes.
Portability Note: In many older Unix systems, this condition was indicated by
EWOULDBLOCK
, which was a distinct error code different fromEAGAIN
. To make your program portable, you should check for both codes and treat them the same.This patch corrects the check in
smb2_read_data
that could fail under aread_more_data
goto and a socket read that returnsEWOULDBLOCK
.Similar checks already appear in the
libsmb2
codebase.https://github.com/sahlberg/libsmb2/blob/c88fe13cb7a3b67cc93db852c385c89c539a0016/lib/socket.c#L277
I noticed that when i was compiling on nintendo switch to test on some tests that i did, So it´s aprovable.
GNU defines
EAGAIN
andEWOULDBLOCK
as the same value but notes both values should be checked for portability.This resolves a
Read from socket failed
issue introduced when building with non-GNU environments that define EAGAIN and EWOULDBLOCK as separate, distinct values.As noted in the GNU libc documentation under 2.2 Error Codes.
This patch corrects the check in
smb2_read_data
that could fail under aread_more_data
goto and a socket read that returnsEWOULDBLOCK
.Similar checks already appear in the
libsmb2
codebase. https://github.com/sahlberg/libsmb2/blob/c88fe13cb7a3b67cc93db852c385c89c539a0016/lib/socket.c#L277