apps/ocsp.c Use the same HAVE_FORK / NO_FORK as in speed.c
authorRichard Levitte <levitte@openssl.org>
Mon, 12 Nov 2018 17:16:27 +0000 (18:16 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 11 Feb 2019 15:44:59 +0000 (16:44 +0100)
This allows the user to override our defaults if needed, and in a
consistent manner.

Partial fix for #7607

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7624)

apps/ocsp.c

index 7c2a9046a80f067b602d1f086f15441ad32a34c0..09eeb9cf14f961aab54035702f5f9f2cbf4a821b 100644 (file)
@@ -36,7 +36,21 @@ NON_EMPTY_TRANSLATION_UNIT
 # include <openssl/x509v3.h>
 # include <openssl/rand.h>
 
-# if defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_NO_SOCK) \
+#ifndef HAVE_FORK
+# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS)
+#  define HAVE_FORK 0
+# else
+#  define HAVE_FORK 1
+# endif
+#endif
+
+#if HAVE_FORK
+# undef NO_FORK
+#else
+# define NO_FORK
+#endif
+
+# if !defined(NO_FORK) && !defined(OPENSSL_NO_SOCK) \
      && !defined(OPENSSL_NO_POSIX_IO)
 #  define OCSP_DAEMON
 #  include <sys/types.h>