aboutsummaryrefslogtreecommitdiff
path: root/libssh
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:16:24 +0200
commitc30a25e64c8318ed77e30a31fda0d9157caeafaf (patch)
treed6ebece90d75da2226d45854fd56fe0b4f37ea82 /libssh
parentb9a9f54c452aeb9083398a956bd590c37661f489 (diff)
downloadlibssh-c30a25e64c8318ed77e30a31fda0d9157caeafaf.tar.gz
libssh-c30a25e64c8318ed77e30a31fda0d9157caeafaf.tar.xz
libssh-c30a25e64c8318ed77e30a31fda0d9157caeafaf.zip
poll: Fixed a malfunction with wrong max fd value check.
Diffstat (limited to 'libssh')
-rw-r--r--libssh/poll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libssh/poll.c b/libssh/poll.c
index 5eb80aaa..f6a81749 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -135,7 +135,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;
}
@@ -157,7 +157,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;
}