]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
CMake: fix HAVE_DAEMON detection on Linux
authorLev Stipakov <lev@openvpn.net>
Fri, 22 Sep 2023 10:39:00 +0000 (12:39 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 22 Sep 2023 12:14:54 +0000 (14:14 +0200)
On Linux, daemon() is defined in unistd.h, not in
stdlib.h like in MacOS or FreeBSD.

Change-Id: I30f4ea502a36eca155cbc79b89c0d18ee3419877
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230922103900.37205-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27058.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
CMakeLists.txt

index 454ef62d4d380ab18b3965cbca62f6a8c09483dc..376a06091106e41375fcffc5d882bd17b86c75fd 100644 (file)
@@ -158,7 +158,7 @@ check_symbol_exists(epoll_create sys/epoll.h HAVE_EPOLL_CREATE)
 check_symbol_exists(gettimeofday sys/time.h HAVE_GETTIMEOFDAY)
 check_symbol_exists(basename libgen.h HAVE_BASENAME)
 check_symbol_exists(chsize io.h HAVE_CHSIZE)
-check_symbol_exists(daemon stdlib.h HAVE_DAEMON)
+check_symbol_exists(daemon "unistd.h;stdlib.h" HAVE_DAEMON)
 check_symbol_exists(dirname libgen.h HAVE_DIRNAME)
 check_symbol_exists(getrlimit sys/resource.h HAVE_GETRLIMIT)
 check_symbol_exists(mlockall sys/mman.h HAVE_MLOCKALL)