summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-08 14:56:53 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-10 16:17:18 +0200
commit8c1dbbef35bea4082eacfe4e626e7726b9e84349 (patch)
tree4912898da8a1e825b5162394cb4d3254196601c2
parent3093c60f4995c4b37ace3901951b9f244b6d416c (diff)
CMake: Check for ptsname_r() again
This was dropped in autotools as I found no use of the HAVE_PTSNAME_R macro. Turns out it was typoed as HAVE_PTS_NAME_R. Fix the #ifdef and add checks to CMake for it. Closes: #833674
-rw-r--r--CMake/config.h.in3
-rw-r--r--CMakeLists.txt1
-rw-r--r--apt-pkg/deb/dpkgpm.cc2
3 files changed, 5 insertions, 1 deletions
diff --git a/CMake/config.h.in b/CMake/config.h.in
index 3afd9123c..e929646fa 100644
--- a/CMake/config.h.in
+++ b/CMake/config.h.in
@@ -34,6 +34,9 @@
#cmakedefine HAVE_SETRESUID
#cmakedefine HAVE_SETRESGID
+/* Check for ptsname_r() */
+#cmakedefine HAVE_PTSNAME_R
+
/* Define the arch name string */
#define COMMON_ARCH "${COMMON_ARCH}"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 254e34869..7e432bca3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,6 +102,7 @@ check_function_exists(getresuid HAVE_GETRESUID)
check_function_exists(getresgid HAVE_GETRESGID)
check_function_exists(setresuid HAVE_SETRESUID)
check_function_exists(setresgid HAVE_SETRESGID)
+check_function_exists(ptsname_r HAVE_PTSNAME_R)
check_function_exists(timegm HAVE_TIMEGM)
test_big_endian(WORDS_BIGENDIAN)
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index c1b9a28f4..ccfc77d6a 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1086,7 +1086,7 @@ void pkgDPkgPM::StartPtyMagic() /*{{{*/
_error->Errno("unlockpt", "Unlocking the slave of master fd %d failed!", d->master);
else
{
-#ifdef HAVE_PTS_NAME_R
+#ifdef HAVE_PTSNAME_R
char slave_name[64]; // 64 is used by bionic
if (ptsname_r(d->master, slave_name, sizeof(slave_name)) != 0)
#else