diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 580a8550..034edba0 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1238,10 +1238,18 @@ possibly_become_daemon(const struct options *options) { ASSERT(!options->inetd); /* Don't chdir immediately, but the end of the init sequence, if needed */ + +#if defined(__APPLE__) && defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif if (daemon(1, options->log) < 0) { msg(M_ERR, "daemon() failed or unsupported"); } +#if defined(__APPLE__) && defined(__clang__) +#pragma clang diagnostic pop +#endif restore_signal_state(); if (options->log) { diff --git a/src/plugins/down-root/down-root.c b/src/plugins/down-root/down-root.c index c5e5023e..da445c61 100644 --- a/src/plugins/down-root/down-root.c +++ b/src/plugins/down-root/down-root.c @@ -173,10 +173,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) { warn("DOWN-ROOT: daemonization failed"); } +#if defined(__APPLE__) && defined(__clang__) +#pragma clang diagnostic pop +#endif else if (fd >= 3) { dup2(fd, 2);