1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

connect: Check that errno is 0 to fix Windows build.

Thanks to Viktor Butskih.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2014-12-25 12:33:29 +01:00
parent bb18442fe8
commit e051135a05

View File

@@ -382,8 +382,9 @@ socket_t ssh_connect_host_nonblocking(ssh_session session, const char *host,
continue;
}
errno = 0;
rc = connect(s, itr->ai_addr, itr->ai_addrlen);
if (rc == -1 && (errno != EINPROGRESS)) {
if (rc == -1 && (errno != 0) && (errno != EINPROGRESS)) {
ssh_set_error(session, SSH_FATAL,
"Failed to connect: %s", strerror(errno));
ssh_connect_socket_close(s);