From 8be7ece1f59fe0a48f1e2bcf8be6fbd88ba7c68f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 17 Jun 2010 13:37:42 +0200 Subject: [PATCH] client: Fixed fd checks. --- libssh/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libssh/client.c b/libssh/client.c index 45b3df00..9a9d6a05 100644 --- a/libssh/client.c +++ b/libssh/client.c @@ -685,7 +685,7 @@ int ssh_connect(ssh_session session) { leave_function(); return SSH_ERROR; } - if (session->fd == -1 && session->host == NULL && session->ProxyCommand == NULL) { + if (session->fd == SSH_INVALID_SOCKET && session->host == NULL && session->ProxyCommand == NULL) { ssh_set_error(session, SSH_FATAL, "Hostname required"); leave_function(); return SSH_ERROR; @@ -704,7 +704,7 @@ int ssh_connect(ssh_session session) { session->socket_callbacks.data=callback_receive_banner; session->socket_callbacks.exception=socket_callback_exception; session->socket_callbacks.userdata=session; - if (session->fd != -1) { + if (session->fd != SSH_INVALID_SOCKET) { ssh_socket_set_fd(session->socket, session->fd); ret=SSH_OK; #ifndef _WIN32