Author: gonzalo
Date: 2005-04-08 22:41:42 -0400 (Fri, 08 Apr 2005)
New Revision: 42722

Modified:
   trunk/mono/mono/utils/ChangeLog
   trunk/mono/mono/utils/mono-poll.c
   trunk/mono/mono/utils/mono-poll.h
Log:
2005-04-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * mono-poll.c: windows return code translation.
        * mono-poll.h: FD_SETSIZE must be defined when compiling everything.
        Moved to configure.in.



Modified: trunk/mono/mono/utils/ChangeLog
===================================================================
--- trunk/mono/mono/utils/ChangeLog     2005-04-09 00:25:52 UTC (rev 42721)
+++ trunk/mono/mono/utils/ChangeLog     2005-04-09 02:41:42 UTC (rev 42722)
@@ -1,3 +1,9 @@
+2005-04-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * mono-poll.c: windows return code translation.
+       * mono-poll.h: FD_SETSIZE must be defined when compiling everything.
+       Moved to configure.in.
+
 2005-04-06 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * mono-poll.[ch]: mono_poll uses poll() when available, otherwise

Modified: trunk/mono/mono/utils/mono-poll.c
===================================================================
--- trunk/mono/mono/utils/mono-poll.c   2005-04-09 00:25:52 UTC (rev 42721)
+++ trunk/mono/mono/utils/mono-poll.c   2005-04-09 02:41:42 UTC (rev 42722)
@@ -1,4 +1,5 @@
 #include "mono-poll.h"
+#include <errno.h>
 
 #ifdef HAVE_POLL
 int
@@ -62,8 +63,25 @@
        }
 
        affected = select (maxfd + 1, &rfds, &wfds, &efds, tvptr);
-       if (affected == -1) /* EBADF should be translated to POLLNVAL */
+       if (affected == -1) {
+#ifdef PLATFORM_WIN32
+               int error = WSAGetLastError ();
+               switch (error) {
+               case WSAEFAULT: errno = EFAULT; break;
+               case WSAEINVAL: errno = EINVAL; break;
+               case WSAEINTR: errno = EINTR; break;
+               /* case WSAEINPROGRESS: errno = EINPROGRESS; break; */
+               case WSAEINPROGRESS: errno = EINTR; break;
+               case WSAENOTSOCK: errno = EBADF; break;
+#ifdef ENOSR
+               case WSAENETDOWN: errno = ENOSR; break;
+#endif
+               default: errno = 0;
+               }
+#endif
+
                return -1;
+       }
 
        count = 0;
        for (i = 0; i < nfds && affected > 0; i++) {

Modified: trunk/mono/mono/utils/mono-poll.h
===================================================================
--- trunk/mono/mono/utils/mono-poll.h   2005-04-09 00:25:52 UTC (rev 42721)
+++ trunk/mono/mono/utils/mono-poll.h   2005-04-09 02:41:42 UTC (rev 42722)
@@ -21,8 +21,6 @@
 #else
 
 #ifdef PLATFORM_WIN32
-/* The default in cygwin header files is 64 */
-#define FD_SETSIZE             1024
 #include <windows.h>
 #endif
 #define MONO_POLLIN            1

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to