aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-07-22 10:41:58 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-07-23 10:44:51 +0200
commitdf81a05505514b384d10c9b192137584040e4984 (patch)
tree79c078d9f70668ccb42836489dee3febb2abd7d0 /src
parent7d07e1f1bd06b509b8ee4bae4b22338c5e16735a (diff)
downloadlibssh-df81a05505514b384d10c9b192137584040e4984.tar.gz
libssh-df81a05505514b384d10c9b192137584040e4984.tar.xz
libssh-df81a05505514b384d10c9b192137584040e4984.zip
cmake: Check for unistd.h.
Diffstat (limited to 'src')
-rw-r--r--src/agent.c4
-rw-r--r--src/channels1.c2
-rw-r--r--src/getpass.c6
-rw-r--r--src/gssapi.c27
-rw-r--r--src/poll.c5
5 files changed, 29 insertions, 15 deletions
diff --git a/src/agent.c b/src/agent.c
index 1f7454e6..1b094ed4 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -42,12 +42,12 @@
#include <string.h>
#include <stdio.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
-#ifndef _WIN32
#include <netinet/in.h>
#include <arpa/inet.h>
-#endif
#include "libssh/agent.h"
#include "libssh/priv.h"
diff --git a/src/channels1.c b/src/channels1.c
index 30030db0..bc66488d 100644
--- a/src/channels1.c
+++ b/src/channels1.c
@@ -27,6 +27,8 @@
#include <stdio.h>
#ifndef _WIN32
#include <arpa/inet.h>
+#endif
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/src/getpass.c b/src/getpass.c
index cc6d33ca..0ffb955d 100644
--- a/src/getpass.c
+++ b/src/getpass.c
@@ -21,6 +21,8 @@
* MA 02111-1307, USA.
*/
+#include "config.h"
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -163,8 +165,12 @@ int ssh_getpass(const char *prompt,
#else
#include <fcntl.h>
+#ifdef HAVE_TERMIOS_H
#include <termios.h>
+#endif
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
/**
* @ingroup libssh_misc
diff --git a/src/gssapi.c b/src/gssapi.c
index 5856d114..228eaef7 100644
--- a/src/gssapi.c
+++ b/src/gssapi.c
@@ -19,21 +19,24 @@
* MA 02111-1307, USA.
*/
-#include "libssh/gssapi.h"
-#include "libssh/libssh.h"
-#include "libssh/ssh2.h"
-#include "libssh/buffer.h"
-#include "libssh/crypto.h"
-#include "libssh/callbacks.h"
-#include "libssh/string.h"
-#include "libssh/server.h"
+#include "config.h"
-#include <gssapi.h>
-
-/* to remove */
#include <stdio.h>
-#include <unistd.h>
#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <gssapi.h>
+
+#include <libssh/gssapi.h>
+#include <libssh/libssh.h>
+#include <libssh/ssh2.h>
+#include <libssh/buffer.h>
+#include <libssh/crypto.h>
+#include <libssh/callbacks.h>
+#include <libssh/string.h>
+#include <libssh/server.h>
/** current state of an GSSAPI authentication */
enum ssh_gssapi_state_e {
diff --git a/src/poll.c b/src/poll.c
index 85ee655d..bde0198d 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -115,10 +115,13 @@ static poll_fn ssh_poll_emu;
#else /* _WIN32 */
#include <sys/select.h>
#include <sys/socket.h>
-#include <unistd.h>
#include <sys/time.h>
#endif /* _WIN32 */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
/*
* This is a poll(2)-emulation using select for systems not providing a native