]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
* Fix #92: ldns-testns.c:429:15: error: 'fork' is unavailable: not
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 10 Mar 2020 08:22:02 +0000 (09:22 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 10 Mar 2020 08:22:02 +0000 (09:22 +0100)
  available on tvOS.

Changelog
configure.ac
examples/ldns-testns.c

index a557b103991e587a3420891e8177f8574df59676..706d2b6b81f811764c9811022560ea61bdb818b1 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -9,6 +9,8 @@
        * Fix memory leak in examples/ldns-testns handle_tcp routine.
        * Detect fixed time memory compare for openssl 0.9.8.
        * Fix compile warning by variable initialisation for older gcc.
+       * Fix #92: ldns-testns.c:429:15: error: 'fork' is unavailable: not
+         available on tvOS.
 
 1.7.1  2019-07-26
        * bugfix: Manage verification paths for OpenSSL >= 1.1.0
index 28d8ed3728a8ccd85412fe2bf3212453cf141e70..ab885d2b9e9862a6cf62d5702853481a7cea4a9b 100644 (file)
@@ -860,6 +860,16 @@ AC_REPLACE_FUNCS(snprintf)
 AC_REPLACE_FUNCS(strlcpy)
 AC_REPLACE_FUNCS(memmove)
 AC_FUNC_FORK
+AC_MSG_CHECKING([compile of fork])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <unistd.h>
+], [
+       (void)fork();
+])], [
+       AC_MSG_RESULT(yes)
+       AC_DEFINE([HAVE_FORK_AVAILABLE], 1, [if fork is available for compile])
+], [   AC_MSG_RESULT(no)
+])
 AC_CHECK_FUNCS([endprotoent endservent sleep random fcntl strtoul bzero memset b32_ntop b32_pton])
 if test "x$HAVE_B32_NTOP" = "xyes"; then
        AC_SUBST(ldns_build_config_have_b32_ntop, 1)
index b5d6dd47953fecb525b41322514aee3f116a0fb7..a44ad74d49a1506ac557dcbbb3e946d6fbbac25a 100644 (file)
@@ -410,7 +410,7 @@ forkit(int number)
        int i;
        for(i=0; i<number; i++)
        {
-#ifndef HAVE_FORK
+#if !defined(HAVE_FORK) || !defined(HAVE_FORK_AVAILABLE)
 #ifndef USE_WINSOCK
                log_msg("fork() not available.\n");
                exit(1);