diff --git a/src/session.c b/src/session.c index ccb6497..7276d8b 100644 --- a/src/session.c +++ b/src/session.c @@ -37,7 +37,7 @@ #include "libssh2_priv.h" #include -#ifndef WIN32 +#ifdef HAVE_UNISTD_H #include #endif #include @@ -101,7 +101,7 @@ static int libssh2_banner_receive(LIBSSH2_SESSION *session) break; case WSAENOTCONN: case WSAECONNABORTED: - errno = ENOTCONN; + errno = WSAENOTCONN; break; case WSAEINTR: errno = EINTR;