summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Horman <nhorman@openssl.org>2024-04-06 16:30:50 -0400
committerNeil Horman <nhorman@openssl.org>2024-04-12 08:02:20 -0400
commit3b56cd4f041cc78035aafd0f9afe50dd4a6dc1ed (patch)
tree9292926589e02630fe500bb89ea745ebe30538c0
parent7acdd776e322814238c2c58296ecfcf0d16d5cf7 (diff)
Don't include unistd.h in sconnect for windows
The platform doesn't support it Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> (Merged from https://github.com/openssl/openssl/pull/24047)
-rw-r--r--demos/bio/sconnect.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/demos/bio/sconnect.c b/demos/bio/sconnect.c
index da7d0197f3..917d729ba7 100644
--- a/demos/bio/sconnect.c
+++ b/demos/bio/sconnect.c
@@ -16,11 +16,16 @@
*/
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
+#if !defined(OPENSSL_SYS_WINDOWS)
+#include <unistd.h>
+#else
+#include <windows.h>
+# define sleep(x) Sleep(x*1000)
+#endif
#define HOSTPORT "localhost:4433"
#define CAFILE "root.pem"