summaryrefslogtreecommitdiffstats
path: root/libssh/poll.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-06-17 11:16:24 +0200
committerAndreas Schneider <asn@cynapses.org>2010-06-17 11:23:50 +0200
commita375ebe29b7947a42d845f6f84c9129c0a8ee0aa (patch)
treec1028a8b996eb7e2481fea053c5a5fa184b6fb5c /libssh/poll.c
parentb2f49a6a93db0b6039c609a4e60e3fbc70b77260 (diff)
poll: Fixed a malfunction with wrong max fd value check.
Diffstat (limited to 'libssh/poll.c')
-rw-r--r--libssh/poll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libssh/poll.c b/libssh/poll.c
index b28d2c4f..5ce14b2b 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -110,7 +110,7 @@ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
FD_ZERO (&exceptfds);
/* compute fd_sets and find largest descriptor */
- for (max_fd = -1, i = 0; i < nfds; i++) {
+ for (max_fd = 0, i = 0; i < nfds; i++) {
if (fds[i].fd < 0) {
continue;
}
@@ -132,7 +132,7 @@ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
}
}
- if (max_fd == -1) {
+ if (max_fd == (socket_t) -1) {
errno = EINVAL;
return -1;
}