Handle EINTR to fix streaming with GDB attached

This commit is contained in:
Cameron Gutman 2018-08-10 15:51:17 -07:00
parent 72bbbb7549
commit feb46b978e
2 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,7 @@ int recvUdpSocket(SOCKET s, char* buffer, int size, int useSelect) {
err = (int)recv(s, buffer, size, 0);
if (err < 0 &&
(LastSocketError() == EWOULDBLOCK ||
LastSocketError() == EINTR ||
LastSocketError() == EAGAIN)) {
// Return 0 for timeout
return 0;

View File

@ -12,6 +12,7 @@
#define SHUT_RDWR SD_BOTH
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EAGAIN WSAEWOULDBLOCK
#define EINTR WSAEINTR
typedef int SOCK_RET;
typedef int SOCKADDR_LEN;
@ -53,8 +54,10 @@ typedef socklen_t SOCKADDR_LEN;
#define TCP_NODELAY SCE_NET_TCP_NODELAY
#undef EAGAIN
#undef EWOULDBLOCK
#undef EINTR
#define EAGAIN SCE_NET_EAGAIN
#define EWOULDBLOCK SCE_NET_EWOULDBLOCK
#define EINTR SCE_NET_EINTR
#define sockaddr_in6 sockaddr_in
#define sin6_addr sin_addr