Fix netplay on modern versions of Visual Studio, from Ala-lala

This commit is contained in:
Michael Martin
2019-10-01 23:56:25 -07:00
parent ab9a04979a
commit d884b3f6d6
+12 -13
View File
@@ -146,19 +146,18 @@ dataReadyCallback(NetDescriptor *nd) {
} }
if (numRead == -1) { if (numRead == -1) {
switch (errno) { if (errno == EWOULDBLOCK || errno == EAGAIN)
case EAGAIN: // No more data for now. return; // No more data for now.
return; else if (errno == EINTR)
case EINTR: // System call was interrupted. Retry. continue; // System call was interrupted. Retry.
continue; else
default: { {
int savedErrno = errno; int savedErrno = errno;
log_add(log_Error, "recv() failed: %s.\n", log_add(log_Error, "recv() failed: %s.\n",
strerror(errno)); strerror(errno));
NetConnection_doErrorCallback(conn, savedErrno); NetConnection_doErrorCallback(conn, savedErrno);
NetDescriptor_close(nd); NetDescriptor_close(nd);
return; return;
}
} }
} }