aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-06-17 13:25:45 +0200
committerAndreas Schneider <asn@cynapses.org>2010-06-17 13:25:45 +0200
commit15e4e7e9da3b1aa58765b9c48aff96e0899413b3 (patch)
tree5d388ec8d976b0f978eeaa43e04ff26dfd318ed0
parentd484d4e1299452ac4d103ce5c27f05db05041c6c (diff)
downloadlibssh-15e4e7e9da3b1aa58765b9c48aff96e0899413b3.tar.gz
libssh-15e4e7e9da3b1aa58765b9c48aff96e0899413b3.tar.xz
libssh-15e4e7e9da3b1aa58765b9c48aff96e0899413b3.zip
poll: Fixed type of the fd variables and use SSH_INVALID_SOCKET.
-rw-r--r--libssh/poll.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libssh/poll.c b/libssh/poll.c
index 5ad12ca0..0de7a235 100644
--- a/libssh/poll.c
+++ b/libssh/poll.c
@@ -136,7 +136,7 @@ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
/* compute fd_sets and find largest descriptor */
for (max_fd = 0, i = 0; i < nfds; i++) {
- if (fds[i].fd == (socket_t) -1) {
+ if (fds[i].fd == SSH_INVALID_SOCKET) {
continue;
}
@@ -157,7 +157,7 @@ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) {
}
}
- if (max_fd == (socket_t) -1) {
+ if (max_fd == SSH_INVALID_SOCKET) {
errno = EINVAL;
return -1;
}
@@ -443,7 +443,7 @@ void ssh_poll_ctx_free(ssh_poll_ctx ctx) {
used = ctx->polls_used;
for (i = 0; i < used; ) {
ssh_poll_handle p = ctx->pollptrs[i];
- int fd = ctx->pollfds[i].fd;
+ socket_t fd = ctx->pollfds[i].fd;
/* force poll object removal */
if (p->cb(p, fd, POLLERR, p->cb_data) < 0) {
@@ -491,7 +491,7 @@ static int ssh_poll_ctx_resize(ssh_poll_ctx ctx, size_t new_size) {
* @return 0 on success, < 0 on error
*/
int ssh_poll_ctx_add(ssh_poll_ctx ctx, ssh_poll_handle p) {
- int fd;
+ socket_t fd;
if (p->ctx != NULL) {
/* already attached to a context */