#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
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
/**
* 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.
*/