mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Fix typedef collisons on Solaris.
This commit is contained in:
@@ -140,13 +140,13 @@ typedef BN_CTX* bignum_CTX;
|
|||||||
/* poll support */
|
/* poll support */
|
||||||
#ifdef HAVE_POLL
|
#ifdef HAVE_POLL
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
typedef struct pollfd pollfd_t;
|
typedef struct pollfd ssh_pollfd_t;
|
||||||
#else /* HAVE_POLL */
|
#else /* HAVE_POLL */
|
||||||
typedef struct pollfd_s {
|
typedef struct ssh_pollfd_struct {
|
||||||
socket_t fd; /* file descriptor */
|
socket_t fd; /* file descriptor */
|
||||||
short events; /* requested events */
|
short events; /* requested events */
|
||||||
short revents; /* returned events */
|
short revents; /* returned events */
|
||||||
} pollfd_t;
|
} ssh_pollfd_t;
|
||||||
|
|
||||||
/* poll.c */
|
/* poll.c */
|
||||||
#ifndef POLLIN
|
#ifndef POLLIN
|
||||||
@@ -558,7 +558,7 @@ ssh_string agent_sign_data(struct ssh_session_struct *session,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* poll.c */
|
/* 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_ctx SSH_POLL_CTX;
|
||||||
typedef struct ssh_poll SSH_POLL;
|
typedef struct ssh_poll SSH_POLL;
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ struct ssh_poll {
|
|||||||
|
|
||||||
struct ssh_poll_ctx {
|
struct ssh_poll_ctx {
|
||||||
SSH_POLL **pollptrs;
|
SSH_POLL **pollptrs;
|
||||||
pollfd_t *pollfds;
|
ssh_pollfd_t *pollfds;
|
||||||
size_t polls_allocated;
|
size_t polls_allocated;
|
||||||
size_t polls_used;
|
size_t polls_used;
|
||||||
size_t chunk_size;
|
size_t chunk_size;
|
||||||
@@ -58,7 +58,7 @@ struct ssh_poll_ctx {
|
|||||||
#ifdef HAVE_POLL
|
#ifdef HAVE_POLL
|
||||||
#include <poll.h>
|
#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);
|
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>
|
#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);
|
return WSAPoll(fds, nfds, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,9 +84,9 @@ int ssh_poll(pollfd_t *fds, nfds_t nfds, int timeout) {
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
static int poll_rest (HANDLE *handles, int nhandles,
|
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;
|
DWORD ready;
|
||||||
pollfd_t *f;
|
ssh_pollfd_t *f;
|
||||||
int recursed_result;
|
int recursed_result;
|
||||||
|
|
||||||
if (nhandles == 0) {
|
if (nhandles == 0) {
|
||||||
@@ -143,9 +143,9 @@ static int poll_rest (HANDLE *handles, int nhandles,
|
|||||||
return 0;
|
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];
|
HANDLE handles[MAXIMUM_WAIT_OBJECTS];
|
||||||
pollfd_t *f;
|
ssh_pollfd_t *f;
|
||||||
int nhandles = 0;
|
int nhandles = 0;
|
||||||
int rc = -1;
|
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) {
|
static int ssh_poll_ctx_resize(SSH_POLL_CTX *ctx, size_t new_size) {
|
||||||
SSH_POLL **pollptrs;
|
SSH_POLL **pollptrs;
|
||||||
pollfd_t *pollfds;
|
ssh_pollfd_t *pollfds;
|
||||||
|
|
||||||
pollptrs = realloc(ctx->pollptrs, sizeof(SSH_POLL *) * new_size);
|
pollptrs = realloc(ctx->pollptrs, sizeof(SSH_POLL *) * new_size);
|
||||||
if (pollptrs == NULL) {
|
if (pollptrs == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pollfds = realloc(ctx->pollfds, sizeof(pollfd_t) * new_size);
|
pollfds = realloc(ctx->pollfds, sizeof(ssh_pollfd_t) * new_size);
|
||||||
if (pollfds == NULL) {
|
if (pollfds == NULL) {
|
||||||
ctx->pollptrs = realloc(pollptrs, sizeof(SSH_POLL *) * ctx->polls_allocated);
|
ctx->pollptrs = realloc(pollptrs, sizeof(SSH_POLL *) * ctx->polls_allocated);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ int ssh_socket_wait_for_data(struct socket *s, SSH_SESSION *session, uint32_t le
|
|||||||
/* ssh_socket_poll */
|
/* ssh_socket_poll */
|
||||||
int ssh_socket_poll(struct socket *s, int *writeable, int *except) {
|
int ssh_socket_poll(struct socket *s, int *writeable, int *except) {
|
||||||
SSH_SESSION *session = s->session;
|
SSH_SESSION *session = s->session;
|
||||||
pollfd_t fd[1];
|
ssh_pollfd_t fd[1];
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
enter_function();
|
enter_function();
|
||||||
|
|||||||
Reference in New Issue
Block a user