[Openvpn-devel,v3] Add check for nice in cmake config

Message ID 20231128104129.62761-1-frank@lichtenheld.com
State Accepted
Headers show
Series [Openvpn-devel,v3] Add check for nice in cmake config | expand

Commit Message

Frank Lichtenheld Nov. 28, 2023, 10:41 a.m. UTC
From: Arne Schwabe <arne@rfc2549.org>

Change-Id: I2cc8f9b82079acca250db5871ffd9fad2997d1a8
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/444
This mail reflects revision 3 of this Change.
Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>

Comments

Gert Doering Dec. 2, 2023, 4:07 p.m. UTC | #1
Indeed, having that check would be nice :-)

Your patch has been applied to the master and releae/2.6 branch (bugfix).

commit 4d8ee61ce2c2a8b387773d33b4dd01bc2e147941 (master)
commit cc81f014bcbcfb248fdae91dc3527565c5889ff4 (release/2.6)
Author: Arne Schwabe
Date:   Tue Nov 28 11:41:29 2023 +0100

     Add check for nice in cmake config

     Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Message-Id: <20231128104129.62761-1-frank@lichtenheld.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27574.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe9b596..f82ee96 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,6 +146,7 @@ 
 check_symbol_exists(fork unistd.h HAVE_FORK)
 check_symbol_exists(execve unistd.h HAVE_EXECVE)
 check_symbol_exists(ftruncate unistd.h HAVE_FTRUNCATE)
+check_symbol_exists(nice unistd.h HAVE_NICE)
 check_symbol_exists(setgid unistd.h HAVE_SETGID)
 check_symbol_exists(setuid unistd.h HAVE_SETUID)
 check_symbol_exists(setsid unistd.h HAVE_SETSID)
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 85f5fa5..bf582bc 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -212,7 +212,7 @@ 
 #cmakedefine HAVE_NET_TUN_IF_TUN_H
 
 /* Define to 1 if you have the `nice' function. */
-#undef HAVE_NICE
+#cmakedefine HAVE_NICE
 
 /* Define to 1 if you have the `openlog' function. */
 #cmakedefine HAVE_OPENLOG