]> git.sesse.net Git - vlc/blobdiff - modules/misc/gnutls.c
Merge branch 'master' into lpcm_encoder
[vlc] / modules / misc / gnutls.c
index 10671c340bb553db5cd3b252fa1b0c5e3aa80fd4..5c527d2b1213045745417c5f204533ba898f747e 100644 (file)
@@ -36,9 +36,6 @@
 
 #include <sys/types.h>
 #include <errno.h>
-#ifdef HAVE_DIRENT_H
-# include <dirent.h>
-#endif
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
@@ -165,11 +162,12 @@ static int gnutls_Error (vlc_object_t *obj, int val)
     switch (val)
     {
         case GNUTLS_E_AGAIN:
-#ifndef WIN32
+#ifdef WIN32
+            WSASetLastError (WSAEWOULDBLOCK);
+#else
             errno = EAGAIN;
-            break;
 #endif
-            /* WinSock does not return EAGAIN, return EINTR instead */
+            break;
 
         case GNUTLS_E_INTERRUPTED:
 #ifdef WIN32
@@ -238,7 +236,7 @@ gnutls_Recv( void *p_session, void *buf, int i_length )
 /**
  * Starts or continues the TLS handshake.
  *
- * @return -1 on fatal error, 0 on succesful handshake completion,
+ * @return -1 on fatal error, 0 on successful handshake completion,
  * 1 if more would-be blocking recv is needed,
  * 2 if more would-be blocking send is required.
  */