diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-11-05 16:08:49 +0100 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-11-05 16:08:49 +0100 |
commit | f52bc064e9a2d6ce09eaf1ab91090e8d785a88c1 (patch) | |
tree | 377b62441500a904a9331e4327d47a659125cebc /examples | |
parent | 8ab0f8e51f9b39205e22c9ecf83f21d19442b200 (diff) | |
parent | 75f066dfcd530914fad6b69890b5b4c454d1d1e7 (diff) | |
download | libssh-f52bc064e9a2d6ce09eaf1ab91090e8d785a88c1.tar.gz libssh-f52bc064e9a2d6ce09eaf1ab91090e8d785a88c1.tar.xz libssh-f52bc064e9a2d6ce09eaf1ab91090e8d785a88c1.zip |
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
Diffstat (limited to 'examples')
-rw-r--r-- | examples/samplesshd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/samplesshd.c b/examples/samplesshd.c index 142e8805..f2013b76 100644 --- a/examples/samplesshd.c +++ b/examples/samplesshd.c @@ -14,7 +14,10 @@ clients must be made or how a client should react. #include <libssh/libssh.h> #include <libssh/server.h> + +#ifdef HAVE_ARGP_H #include <argp.h> +#endif #include <stdlib.h> #include <string.h> #include <stdio.h> @@ -34,7 +37,7 @@ static int auth_password(char *user, char *password){ return 0; return 1; // authenticated } - +#ifdef HAVE_ARGP_H const char *argp_program_version = "libssh server example " SSH_STRINGIFY(LIBSSH_VERSION); const char *argp_program_bug_address = "<libssh@libssh.org>"; @@ -135,6 +138,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) { /* Our argp parser. */ static struct argp argp = {options, parse_opt, args_doc, doc, NULL, NULL, NULL}; +#endif /* HAVE_ARGP_H */ int main(int argc, char **argv){ ssh_session session; @@ -153,12 +157,13 @@ int main(int argc, char **argv){ ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_DSAKEY, KEYS_FOLDER "ssh_host_dsa_key"); ssh_bind_options_set(sshbind, SSH_BIND_OPTIONS_RSAKEY, KEYS_FOLDER "ssh_host_rsa_key"); +#ifdef HAVE_ARGP_H /* * Parse our arguments; every option seen by parse_opt will * be reflected in arguments. */ argp_parse (&argp, argc, argv, 0, 0, sshbind); - +#endif if(ssh_bind_listen(sshbind)<0){ printf("Error listening to socket: %s\n",ssh_get_error(sshbind)); return 1; |