Merge pull request #13850 from unknownbrackets/warnings

Cleanup some warnings and a logger shutdown crash
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2021-01-01 19:53:10 +01:00
commit fa466d2363
20 files changed
+68 -804

No files matched your search

+9 -1
View File
@@ -176,7 +176,7 @@ void InputSink::Fill() {
// Whatever isn't valid and follows write_ is what's available.
size_t avail = BUFFER_SIZE - std::max(write_, valid_);
int bytes = recv(fd_, buf_ + write_, (int)avail, 0);
int bytes = recv(fd_, buf_ + write_, (int)avail, MSG_NOSIGNAL);
AccountFill(bytes);
}
}
@@ -399,6 +399,14 @@ void OutputSink::AccountPush(size_t bytes) {
void OutputSink::AccountDrain(int bytes) {
if (bytes < 0) {
#if PPSSPP_PLATFORM(WINDOWS)
int err = WSAGetLastError();
if (err == WSAEWOULDBLOCK)
return;
#else
if (errno == EWOULDBLOCK || errno == EAGAIN)
return;
#endif
ERROR_LOG(IO, "Error writing to socket");
return;
}