diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-02-02 16:17:02 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-02-02 16:17:02 +0000 |
commit | 8c60d864c74537c1d60be593f3ed02d35b88b4e5 (patch) | |
tree | 3f176c42d411a28147173451d166bf7adaa534dd | |
parent | 974a160fd31c10852e9bb811d14a33cff1bae7c4 (diff) | |
download | libssh-8c60d864c74537c1d60be593f3ed02d35b88b4e5.tar.gz libssh-8c60d864c74537c1d60be593f3ed02d35b88b4e5.tar.xz libssh-8c60d864c74537c1d60be593f3ed02d35b88b4e5.zip |
Fix build warings in the server code.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@215 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r-- | include/libssh/server.h | 4 | ||||
-rw-r--r-- | libssh/server.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/libssh/server.h b/include/libssh/server.h index 468cd126..68e3c3e6 100644 --- a/include/libssh/server.h +++ b/include/libssh/server.h @@ -30,12 +30,12 @@ extern "C" { typedef struct ssh_bind_struct SSH_BIND; -SSH_BIND *ssh_bind_new(); +SSH_BIND *ssh_bind_new(void); void ssh_bind_set_options(SSH_BIND *ssh_bind, SSH_OPTIONS *options); int ssh_bind_listen(SSH_BIND *ssh_bind); void ssh_bind_set_blocking(SSH_BIND *ssh_bind,int blocking); int ssh_bind_get_fd(SSH_BIND *ssh_bind); -int ssh_bind_set_toaccept(SSH_BIND *ssh_bind); +void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind); SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind); void ssh_bind_free(SSH_BIND *ssh_bind); int ssh_accept(SSH_SESSION *session); diff --git a/libssh/server.c b/libssh/server.c index 59ffcd76..5000118c 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -81,7 +81,7 @@ static socket_t bind_socket(SSH_BIND *ssh_bind,char *hostname, int port) { return s; } -SSH_BIND *ssh_bind_new(){ +SSH_BIND *ssh_bind_new(void){ SSH_BIND *ptr=malloc(sizeof(SSH_BIND)); memset(ptr,0,sizeof(*ptr)); ptr->bindfd=-1; @@ -129,6 +129,8 @@ void ssh_bind_fd_toaccept(SSH_BIND *ssh_bind){ SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind){ SSH_SESSION *session; PRIVATE_KEY *dsa=NULL, *rsa=NULL; + int fd = -1; + if(ssh_bind->bindfd<0){ ssh_set_error(ssh_bind,SSH_FATAL,"Can't accept new clients on a " "not bound socket."); @@ -153,7 +155,7 @@ SSH_SESSION *ssh_bind_accept(SSH_BIND *ssh_bind){ } ssh_say(2,"RSA private key read successfuly\n"); } - int fd=accept(ssh_bind->bindfd,NULL,NULL); + fd = accept(ssh_bind->bindfd, NULL, NULL); if(fd<0){ ssh_set_error(ssh_bind,SSH_FATAL,"Accepting a new connection: %s", strerror(errno)); @@ -186,7 +188,7 @@ void ssh_bind_free(SSH_BIND *ssh_bind){ extern char *supported_methods[]; -int server_set_kex(SSH_SESSION * session) { +static int server_set_kex(SSH_SESSION * session) { KEX *server = &session->server_kex; SSH_OPTIONS *options = session->options; int i; |