summaryrefslogtreecommitdiff
path: root/os/WaitFor.c
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-11-15 15:06:51 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-11-15 15:06:51 +0000
commit9826b83826190e514ed115e15691ca015780f9bc (patch)
treee6ede7a76c2edc14ff3025fbc0fb65757327cde0 /os/WaitFor.c
parentcecb668149e1956fb29bc89855182349122e2f4e (diff)
Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Added
mingw (Win32) port
Diffstat (limited to 'os/WaitFor.c')
-rw-r--r--os/WaitFor.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/os/WaitFor.c b/os/WaitFor.c
index 4c4628552..20a8b6c38 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -222,7 +222,11 @@ WaitForSomething(int *pClientsReady)
{
i = Select (MaxClients, &LastSelectMask, NULL, NULL, wt);
}
+#ifndef WIN32
selecterr = errno;
+#else
+ selecterr = WSAGetLastError();
+#endif
WakeupHandler(i, (pointer)&LastSelectMask);
#ifdef XTESTEXT1
if (playback_on) {
@@ -244,18 +248,30 @@ WaitForSomething(int *pClientsReady)
return 0;
if (i < 0)
{
+#ifndef WIN32
if (selecterr == EBADF) /* Some client disconnected */
+#else
+ if (selecterr == WSAENOTSOCK) /* Some client disconnected */
+#endif
{
CheckConnections ();
if (! XFD_ANYSET (&AllClients))
return 0;
}
+#ifndef WIN32
else if (selecterr == EINVAL)
+#else
+ else if (selecterr == WSAEINVAL)
+#endif
{
FatalError("WaitForSomething(): select: errno=%d\n",
selecterr);
- }
+ }
+#ifndef WIN32
else if (selecterr != EINTR)
+#else
+ else if (selecterr != WSAEINTR)
+#endif
{
ErrorF("WaitForSomething(): select: errno=%d\n",
selecterr);