diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-22 10:41:58 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-23 10:44:51 +0200 |
commit | df81a05505514b384d10c9b192137584040e4984 (patch) | |
tree | 79c078d9f70668ccb42836489dee3febb2abd7d0 /examples | |
parent | 7d07e1f1bd06b509b8ee4bae4b22338c5e16735a (diff) | |
download | libssh-df81a05505514b384d10c9b192137584040e4984.tar.gz libssh-df81a05505514b384d10c9b192137584040e4984.tar.xz libssh-df81a05505514b384d10c9b192137584040e4984.zip |
cmake: Check for unistd.h.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sample.c | 13 | ||||
-rw-r--r-- | examples/samplesftp.c | 4 | ||||
-rw-r--r-- | examples/sshnetcat.c | 6 |
3 files changed, 18 insertions, 5 deletions
diff --git a/examples/sample.c b/examples/sample.c index 1fd96364..616372cb 100644 --- a/examples/sample.c +++ b/examples/sample.c @@ -14,24 +14,31 @@ clients must be made or how a client should react. #include "config.h" #include <stdio.h> -#include <unistd.h> #include <stdlib.h> #include <string.h> -#include <termios.h> #include <sys/select.h> #include <sys/time.h> + +#ifdef HAVE_TERMIOS_H +#include <termios.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #ifdef HAVE_PTY_H #include <pty.h> #endif + #include <sys/ioctl.h> #include <signal.h> #include <errno.h> +#include <fcntl.h> + #include <libssh/callbacks.h> #include <libssh/libssh.h> #include <libssh/sftp.h> -#include <fcntl.h> #include "examples_common.h" #define MAXCMD 10 diff --git a/examples/samplesftp.c b/examples/samplesftp.c index 968624e8..457e60a4 100644 --- a/examples/samplesftp.c +++ b/examples/samplesftp.c @@ -15,11 +15,13 @@ clients must be made or how a client should react. #include <sys/statvfs.h> #include <stdio.h> -#include <unistd.h> #include <errno.h> #include <fcntl.h> #include <stdlib.h> #include <string.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include <libssh/libssh.h> #include <libssh/sftp.h> diff --git a/examples/sshnetcat.c b/examples/sshnetcat.c index 19f6500a..052cabf4 100644 --- a/examples/sshnetcat.c +++ b/examples/sshnetcat.c @@ -13,10 +13,14 @@ clients must be made or how a client should react. #include "config.h" #include <stdio.h> -#include <unistd.h> #include <stdlib.h> #include <string.h> +#ifdef HAVE_TERMIOS_H #include <termios.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif #include <sys/select.h> #include <sys/time.h> |