]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Ignore deprecation warning for daemon() on macOS (plugin/auth-pam)
authorSaifur Rahman Mohsin <mohsin92@me.com>
Thu, 24 Feb 2022 17:23:30 +0000 (22:53 +0530)
committerGert Doering <gert@greenie.muc.de>
Sat, 26 Feb 2022 10:13:03 +0000 (11:13 +0100)
Follow up to a480eaa (does the same for auth-pam.c).

Signed-off-by: Saifur Rahman Mohsin <mohsin92@me.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220224172330.43451-1-mohsin92@me.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23890.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/plugins/auth-pam/auth-pam.c

index 3be647e943759866a7dca6219fcd5ccbee3beab4..33492e9c5acd8833fde9c85434bf919f9a1c0f28 100644 (file)
@@ -214,10 +214,17 @@ daemonize(const char *envp[])
         {
             fd = dup(2);
         }
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
         if (daemon(0, 0) < 0)
         {
             plugin_log(PLOG_ERR|PLOG_ERRNO, MODULE, "daemonization failed");
         }
+#if defined(__APPLE__) && defined(__clang__)
+#pragma clang diagnostic pop
+#endif
         else if (fd >= 3)
         {
             dup2(fd, 2);