0
0
Fork 0

Fix an endge case in bsd IClient::Poll implementation (#848)

This add some code to handle usage of poll without any fds.

This is required by Dark Souls Remastered main loop logic as it's
calling it without any fds during initialization.

===
General system stability improvements to enhance the user's experience.
This commit is contained in:
Thog 2019-12-22 20:33:59 +01:00 committed by jduncanator
parent bd010869a5
commit bce8972e7a

View file

@ -1,11 +1,12 @@
using Ryujinx.Common;
using Ryujinx.Common.Logging;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.Utilities;
using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{
@ -379,6 +380,8 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
}
}
if (fdsCount != 0)
{
try
{
System.Net.Sockets.Socket.Select(readEvents, writeEvents, errorEvents, timeout);
@ -387,6 +390,17 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd
{
return WriteWinSock2Error(context, (WsaError)exception.ErrorCode);
}
}
else if (timeout == -1)
{
// FIXME: If we get a timeout of -1 and there is no fds to wait on, this should kill the KProces. (need to check that with re)
throw new InvalidOperationException();
}
else
{
// FIXME: We should make the KThread sleep but we can't do much about it yet.
Thread.Sleep(timeout);
}
for (int i = 0; i < fdsCount; i++)
{