]> git.saurik.com Git - apt.git/commitdiff
CMake: Check for ptsname_r() again
authorJulian Andres Klode <jak@debian.org>
Mon, 8 Aug 2016 12:56:53 +0000 (14:56 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 10 Aug 2016 14:17:18 +0000 (16:17 +0200)
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
CMake/config.h.in
CMakeLists.txt
apt-pkg/deb/dpkgpm.cc

index 3afd9123c683ca78d3824c6dfc2baef93ab63ba4..e929646fa4324bf645f8aadde923c696d8272681 100644 (file)
@@ -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}"
 
index 254e348693f30e07d774bb3933ed84bc174260db..7e432bca3932cbca1d2e4406efe20bce7809c66e 100644 (file)
@@ -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)
 
index c1b9a28f4ad1ecd3f363e313c94408db8d871a4a..ccfc77d6a4831ba75a192ea6f6c5faf8999e92b8 100644 (file)
@@ -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