From aaae3c4ec15226c7f64f27b3453376f24d263fed Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 18 Jun 2013 17:05:57 +0200 Subject: [PATCH] connect: Correctly fail in ssh_connect_host_nonblocking(). --- src/connect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/connect.c b/src/connect.c index d581e2c7..8e0d206d 100644 --- a/src/connect.c +++ b/src/connect.c @@ -387,6 +387,8 @@ socket_t ssh_connect_host_nonblocking(ssh_session session, const char *host, ssh_set_error(session, SSH_FATAL, "Failed to set socket non-blocking for %s:%d", host, port); ssh_connect_socket_close(s); + s = -1; + continue; } connect(s, itr->ai_addr, itr->ai_addrlen);