mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-20 11:03:56 +00:00
fix: BSD socket assertion failure in PollImpl
Initialize PollFD.revents field to prevent assertion failures when copying from read buffer. The assertion was failing because revents contained uninitialized data from the buffer. Thanks to Dr.Stug for providing the logs that identified this issue. Fixes assertion failure at core\hle\service\sockets\bsd.cpp:564 Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -546,6 +546,11 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::span<con
|
||||
std::vector<PollFD> fds(nfds);
|
||||
std::memcpy(fds.data(), read_buffer.data(), nfds * sizeof(PollFD));
|
||||
|
||||
// Initialize revents to zero to ensure clean state
|
||||
for (PollFD& pollfd : fds) {
|
||||
pollfd.revents = PollEvents{};
|
||||
}
|
||||
|
||||
if (timeout >= 0) {
|
||||
const s64 seconds = timeout / 1000;
|
||||
const u64 nanoseconds = 1'000'000 * (static_cast<u64>(timeout) % 1000);
|
||||
|
||||
Reference in New Issue
Block a user