]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix #188: unbound-control.c:882:6: error: 'execlp' is unavailable: not available...
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 11 Mar 2020 07:39:48 +0000 (08:39 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 11 Mar 2020 07:39:48 +0000 (08:39 +0100)
configure.ac
smallapp/unbound-control.c

index 14b144b7f7233d63d502ea8493d8f075b761001e..0b92480eba66aa61780e01b67d6d10447da4c116 100644 (file)
@@ -399,6 +399,9 @@ PKG_PROG_PKG_CONFIG
 # Checks for header files.
 AC_CHECK_HEADERS([stdarg.h stdbool.h netinet/in.h netinet/tcp.h sys/param.h sys/socket.h sys/un.h sys/uio.h sys/resource.h arpa/inet.h syslog.h netdb.h sys/wait.h pwd.h glob.h grp.h login_cap.h winsock2.h ws2tcpip.h endian.h sys/endian.h libkern/OSByteOrder.h sys/ipc.h sys/shm.h],,, [AC_INCLUDES_DEFAULT])
 
+# Check for Apple header. This uncovers TARGET_OS_IPHONE, TARGET_OS_TV or TARGET_OS_WATCH 
+AC_CHECK_HEADERS([TargetConditionals.h])
+
 # check for types.  
 # Using own tests for int64* because autoconf builtin only give 32bit.
 AC_CHECK_TYPE(int8_t, signed char)
index 4843a9b3112bc99e3da51f480c18dd9c0f8f6342..ce13ad392d7b707f43cdc6be8692dc7be0328cda 100644 (file)
 #include <sys/un.h>
 #endif
 
+#ifdef HAVE_TARGETCONDITIONAL_H
+#include <TargetConditional.h>
+#endif
+
 static void usage(void) ATTR_NORETURN;
 static void ssl_err(const char* s) ATTR_NORETURN;
 static void ssl_path_err(const char* s, const char *path) ATTR_NORETURN;
@@ -879,11 +883,16 @@ int main(int argc, char* argv[])
        if(argc == 0)
                usage();
        if(argc >= 1 && strcmp(argv[0], "start")==0) {
+#if defined(TARGET_OS_TV) || defined(TARGET_OS_WATCH)
+                       fatal_exit("could not exec unbound: %s",
+                               strerror(ENOSYS));
+#else
                if(execlp("unbound", "unbound", "-c", cfgfile, 
                        (char*)NULL) < 0) {
                        fatal_exit("could not exec unbound: %s",
                                strerror(errno));
                }
+#endif
        }
        if(argc >= 1 && strcmp(argv[0], "stats_shm")==0) {
                print_stats_shm(cfgfile);