]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't include unistd.h in sconnect for windows
authorNeil Horman <nhorman@openssl.org>
Sat, 6 Apr 2024 20:30:50 +0000 (16:30 -0400)
committerNeil Horman <nhorman@openssl.org>
Fri, 12 Apr 2024 12:02:20 +0000 (08:02 -0400)
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)

demos/bio/sconnect.c

index da7d0197f38f79555267421a19f73386f324548a..917d729ba74e48216b56c917965f5530cf10f2ac 100644 (file)
  */
 #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"