summaryrefslogtreecommitdiffstats
path: root/src/core/internal_network
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2023-06-25 23:57:34 +0200
committercomex <comexk@gmail.com>2023-06-26 00:06:52 +0200
commit4a355699219710d0a9ad620722393b3d9a16d84d (patch)
tree69b5d25adffe30e968bdcd47c367e0c1040c4427 /src/core/internal_network
parentssl: rename argument to avoid false positive codespell warning (diff)
downloadyuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar
yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar.gz
yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar.bz2
yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar.lz
yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar.xz
yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.tar.zst
yuzu-4a355699219710d0a9ad620722393b3d9a16d84d.zip
Diffstat (limited to 'src/core/internal_network')
-rw-r--r--src/core/internal_network/network.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/internal_network/network.cpp b/src/core/internal_network/network.cpp
index 39381e06e..0164d12eb 100644
--- a/src/core/internal_network/network.cpp
+++ b/src/core/internal_network/network.cpp
@@ -97,6 +97,8 @@ bool EnableNonBlock(SOCKET fd, bool enable) {
Errno TranslateNativeError(int e) {
switch (e) {
+ case 0:
+ return Errno::SUCCESS;
case WSAEBADF:
return Errno::BADF;
case WSAEINVAL:
@@ -421,9 +423,14 @@ short TranslatePollEvents(PollEvents events) {
translate(PollEvents::WrBand, POLLWRBAND);
#ifdef _WIN32
- if (True(events & PollEvents::Pri)) {
- LOG_WARNING(Service, "Winsock doesn't support POLLPRI");
- }
+ short allowed_events = POLLRDBAND | POLLRDNORM | POLLWRNORM;
+ // Unlike poll on other OSes, WSAPoll will complain if any other flags are set on input.
+ if (result & ~allowed_events) {
+ LOG_DEBUG(Network,
+ "Removing WSAPoll input events 0x{:x} because Windows doesn't support them",
+ result & ~allowed_events);
+ }
+ result &= allowed_events;
#endif
UNIMPLEMENTED_IF_MSG((u16)events != 0, "Unhandled guest events=0x{:x}", (u16)events);