diff options
-rw-r--r-- | include/libssh/priv.h | 8 | ||||
-rw-r--r-- | libssh/poll.c | 18 | ||||
-rw-r--r-- | libssh/socket.c | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 83a004c4..84b424dc 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -140,13 +140,13 @@ typedef BN_CTX* bignum_CTX; /* poll support */ #ifdef HAVE_POLL #include <poll.h> -typedef struct pollfd pollfd_t; +typedef struct pollfd ssh_pollfd_t; #else /* HAVE_POLL */ -typedef struct pollfd_s { +typedef struct ssh_pollfd_struct { socket_t fd; /* file descriptor */ short events; /* requested events */ short revents; /* returned events */ -} pollfd_t; +} ssh_pollfd_t; /* poll.c */ #ifndef POLLIN @@ -558,7 +558,7 @@ ssh_string agent_sign_data(struct ssh_session_struct *session, #endif /* poll.c */ -int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout); +int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout); typedef struct ssh_poll_ctx SSH_POLL_CTX; typedef struct ssh_poll SSH_POLL; diff --git a/libssh/poll.c b/libssh/poll.c index 55183cd9..12ef4205 100644 --- a/libssh/poll.c +++ b/libssh/poll.c @@ -49,7 +49,7 @@ struct ssh_poll { struct ssh_poll_ctx { SSH_POLL **pollptrs; - pollfd_t *pollfds; + ssh_pollfd_t *pollfds; size_t polls_allocated; size_t polls_used; size_t chunk_size; @@ -58,7 +58,7 @@ struct ssh_poll_ctx { #ifdef HAVE_POLL #include <poll.h> -int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout) { +int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { return poll((struct pollfd *) fds, nfds, timeout); } @@ -69,7 +69,7 @@ int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout) { #include <winsock2.h> -int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout) { +int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { return WSAPoll(fds, nfds, timeout); } @@ -84,9 +84,9 @@ int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout) { #include <errno.h> static int poll_rest (HANDLE *handles, int nhandles, - pollfd_t *fds, nfds_t nfds, int timeout) { + ssh_pollfd_t *fds, nfds_t nfds, int timeout) { DWORD ready; - pollfd_t *f; + ssh_pollfd_t *f; int recursed_result; if (nhandles == 0) { @@ -143,9 +143,9 @@ static int poll_rest (HANDLE *handles, int nhandles, return 0; } -int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout) { +int ssh_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) { HANDLE handles[MAXIMUM_WAIT_OBJECTS]; - pollfd_t *f; + ssh_pollfd_t *f; int nhandles = 0; int rc = -1; @@ -419,14 +419,14 @@ void ssh_poll_ctx_free(SSH_POLL_CTX *ctx) { static int ssh_poll_ctx_resize(SSH_POLL_CTX *ctx, size_t new_size) { SSH_POLL **pollptrs; - pollfd_t *pollfds; + ssh_pollfd_t *pollfds; pollptrs = realloc(ctx->pollptrs, sizeof(SSH_POLL *) * new_size); if (pollptrs == NULL) { return -1; } - pollfds = realloc(ctx->pollfds, sizeof(pollfd_t) * new_size); + pollfds = realloc(ctx->pollfds, sizeof(ssh_pollfd_t) * new_size); if (pollfds == NULL) { ctx->pollptrs = realloc(pollptrs, sizeof(SSH_POLL *) * ctx->polls_allocated); return -1; diff --git a/libssh/socket.c b/libssh/socket.c index 8b4c9059..1c332625 100644 --- a/libssh/socket.c +++ b/libssh/socket.c @@ -458,7 +458,7 @@ int ssh_socket_wait_for_data(struct socket *s, SSH_SESSION *session, uint32_t le /* ssh_socket_poll */ int ssh_socket_poll(struct socket *s, int *writeable, int *except) { SSH_SESSION *session = s->session; - pollfd_t fd[1]; + ssh_pollfd_t fd[1]; int rc = -1; enter_function(); |