Forward port of 'Telnet: fix win32 work'.
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 19 Dec 2008 00:30:57 +0000 (01:30 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 19 Dec 2008 00:30:57 +0000 (01:30 +0100)
Should work, but not tested yet.

modules/control/telnet.c

index 6cf4b6d..7a693db 100644 (file)
@@ -373,6 +373,12 @@ static void Run( intf_thread_t *p_intf )
                                    cl->i_mode + 2 );
                 }
 
+#ifdef WIN32
+                if( i_recv <= 0 && WSAGetLastError() == WSAEWOULDBLOCK )
+                {
+                    errno = EAGAIN;
+                }
+#endif
                 if (i_recv <= 0 && ( end || errno != EAGAIN ) )
                     goto drop;
             }