summaryrefslogtreecommitdiffstats
path: root/libssh/socket.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-06-17 13:47:29 +0200
committerAndreas Schneider <asn@cynapses.org>2010-06-17 13:47:29 +0200
commit558f889aae4621000f49eec4f8b668123d28c9ec (patch)
tree78a4b6b738e6d9a62b30ee4892d6a788988975d9 /libssh/socket.c
parent937268eb3e5462ba9ad556dd0d667ae565c7c603 (diff)
downloadlibssh-558f889aae4621000f49eec4f8b668123d28c9ec.tar.gz
libssh-558f889aae4621000f49eec4f8b668123d28c9ec.tar.xz
libssh-558f889aae4621000f49eec4f8b668123d28c9ec.zip
Fixed more fd checks.
Diffstat (limited to 'libssh/socket.c')
-rw-r--r--libssh/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libssh/socket.c b/libssh/socket.c
index 4666961..8ebf360 100644
--- a/libssh/socket.c
+++ b/libssh/socket.c
@@ -312,7 +312,7 @@ int ssh_socket_unix(ssh_socket s, const char *path) {
snprintf(sunaddr.sun_path, sizeof(sunaddr.sun_path), "%s", path);
fd = socket(AF_UNIX, SOCK_STREAM, 0);
- if (fd < 0) {
+ if (fd == SSH_INVALID_SOCKET) {
return -1;
}
@@ -912,7 +912,7 @@ int ssh_socket_connect(ssh_socket s, const char *host, int port, const char *bin
return SSH_ERROR;
fd=ssh_connect_host_nonblocking(s->session,host,bind_addr,port);
ssh_log(session,SSH_LOG_PROTOCOL,"Nonblocking connection socket: %d",fd);
- if(fd < 0)
+ if(fd == SSH_INVALID_SOCKET)
return SSH_ERROR;
ssh_socket_set_fd(s,fd);
s->state=SSH_SOCKET_CONNECTING;