]> git.sesse.net Git - vlc/commitdiff
Forward port [18313] and [18314]. compile fix
authorChristophe Mutricy <xtophe@videolan.org>
Thu, 7 Dec 2006 20:19:52 +0000 (20:19 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Thu, 7 Dec 2006 20:19:52 +0000 (20:19 +0000)
modules/misc/gnutls.c

index f60daaecb83b3be46ed63444fce96f39e2063463..58a052af90fc560b00c21ad9f4057d250bca4ee8 100644 (file)
@@ -155,11 +155,18 @@ static int gnutls_Error (vlc_object_t *obj, int val)
     switch (val)
     {
         case GNUTLS_E_AGAIN:
+#if ! defined(WIN32)
             errno = EAGAIN;
             break;
+#endif
+            /* WinSock does not return EAGAIN, return EINTR instead */
 
         case GNUTLS_E_INTERRUPTED:
+#if defined(WIN32)
+            WSASetLastError(WSAEINTR);
+#else
             errno = EINTR;
+#endif
             break;
 
         default:
@@ -168,7 +175,11 @@ static int gnutls_Error (vlc_object_t *obj, int val)
             if (!gnutls_error_is_fatal (val))
                 msg_Err (obj, "Error above should be handled");
 #endif
+#if defined(WIN32)
+            WSASetLastError(WSAECONNRESET);
+#else
             errno = ECONNRESET;
+#endif
     }
     return -1;
 }