Skip to content

Commit

Permalink
Merge pull request #3316 from sepalani/fix_poll
Browse files Browse the repository at this point in the history
WSAPoll: Fixed - invalid argument was supplied
  • Loading branch information
degasus committed Dec 8, 2015
2 parents 48760c9 + e1e6d2b commit 3e3e607
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Core/Core/IPC_HLE/WII_IPC_HLE_Device_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ typedef struct pollfd pollfd_t;
#include <errno.h>
#endif

// WSAPoll doesn't support POLLPRI and POLLWRBAND flags
#ifdef _WIN32
#define UNSUPPORTED_WSAPOLL POLLPRI | POLLWRBAND
#else
#define UNSUPPORTED_WSAPOLL 0
#endif

// **********************************************************************************
// Handle /dev/net/kd/request requests
CWII_IPC_HLE_Device_net_kd_request::CWII_IPC_HLE_Device_net_kd_request(u32 _DeviceID, const std::string& _rDeviceName)
Expand Down Expand Up @@ -1029,7 +1036,7 @@ IPCCommandResult CWII_IPC_HLE_Device_net_ip_top::IOCtl(u32 _CommandAddress)
);

// Do not pass return-only events to the native poll
ufds[i].events &= ~(POLLERR | POLLHUP | POLLNVAL);
ufds[i].events &= ~(POLLERR | POLLHUP | POLLNVAL | UNSUPPORTED_WSAPOLL);

if (unhandled_events)
ERROR_LOG(WII_IPC_NET, "SO_POLL: unhandled Wii event types: %04x", unhandled_events);
Expand Down

0 comments on commit 3e3e607

Please sign in to comment.