mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-07-06 04:52:09 -07:00
Fix some EINTR handling
This commit is contained in:
parent
6bfbcfc456
commit
40a9dee4ed
3 changed files with 15 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
|||
[](https://ci.appveyor.com/project/thestr4ng3r/chiaki) [](https://builds.sr.ht/~thestr4ng3r/chiaki?)
|
||||
|
||||
Chiaki is a Free and Open Source Software Client for PlayStation 4 and PlayStation 5 Remote Play
|
||||
for Linux, FreeBSD, OpenBSD, Android, macOS, Windows, Nintendo Switch and potentially even more platforms.
|
||||
for Linux, FreeBSD, OpenBSD, NetBSD, Android, macOS, Windows, Nintendo Switch and potentially even more platforms.
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -146,7 +146,15 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_recv_http_header(int sock, char *buf, size_
|
|||
return err;
|
||||
}
|
||||
|
||||
int received = (int)recv(sock, buf, (int)buf_size, 0);
|
||||
int received;
|
||||
do
|
||||
{
|
||||
received = (int)recv(sock, buf, (int)buf_size, 0);
|
||||
#if _WIN32
|
||||
} while(false);
|
||||
#else
|
||||
} while(received < 0 && errno == EINTR);
|
||||
#endif
|
||||
if(received <= 0)
|
||||
return received == 0 ? CHIAKI_ERR_DISCONNECTED : CHIAKI_ERR_NETWORK;
|
||||
|
||||
|
|
|
@ -147,7 +147,11 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_stop_pipe_select_single(ChiakiStopPipe *sto
|
|||
timeout = &timeout_s;
|
||||
}
|
||||
|
||||
int r = select(nfds, &rfds, write ? &wfds : NULL, NULL, timeout);
|
||||
int r;
|
||||
do
|
||||
{
|
||||
r = select(nfds, &rfds, write ? &wfds : NULL, NULL, timeout);
|
||||
} while(r < 0 && errno == EINTR);
|
||||
|
||||
if(r < 0)
|
||||
return CHIAKI_ERR_UNKNOWN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue