generic: remove use of getpt()

glibc-specific and the manual page for it recommends using posix_openpt()
instead

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2020-02-23 18:04:32 +00:00
parent ad62a1101e
commit 7ff41b305d
3 changed files with 0 additions and 4 deletions

View file

@ -163,7 +163,6 @@ if (UNIX)
check_function_exists(revoke HAVE_REVOKE) check_function_exists(revoke HAVE_REVOKE)
check_function_exists(_getpty HAVE__GETPTY) check_function_exists(_getpty HAVE__GETPTY)
check_function_exists(getpt HAVE_GETPT)
check_function_exists(grantpt HAVE_GRANTPT) check_function_exists(grantpt HAVE_GRANTPT)
check_function_exists(unlockpt HAVE_UNLOCKPT) check_function_exists(unlockpt HAVE_UNLOCKPT)
check_function_exists(posix_openpt HAVE_POSIX_OPENPT) check_function_exists(posix_openpt HAVE_POSIX_OPENPT)

View file

@ -2,7 +2,6 @@
#cmakedefine PTM_DEVICE "${PTM_DEVICE}" #cmakedefine PTM_DEVICE "${PTM_DEVICE}"
#cmakedefine HAVE_POSIX_OPENPT 1 #cmakedefine HAVE_POSIX_OPENPT 1
#cmakedefine HAVE_GETPT 1
#cmakedefine HAVE_GRANTPT 1 #cmakedefine HAVE_GRANTPT 1
#cmakedefine HAVE_OPENPTY 1 #cmakedefine HAVE_OPENPTY 1
#cmakedefine HAVE_PTSNAME 1 #cmakedefine HAVE_PTSNAME 1

View file

@ -231,8 +231,6 @@ bool KPty::open()
#ifdef HAVE_POSIX_OPENPT #ifdef HAVE_POSIX_OPENPT
d->masterFd = ::posix_openpt(O_RDWR|O_NOCTTY); d->masterFd = ::posix_openpt(O_RDWR|O_NOCTTY);
#elif defined(HAVE_GETPT)
d->masterFd = ::getpt();
#elif defined(PTM_DEVICE) #elif defined(PTM_DEVICE)
d->masterFd = KDE_open(PTM_DEVICE, O_RDWR|O_NOCTTY); d->masterFd = KDE_open(PTM_DEVICE, O_RDWR|O_NOCTTY);
#else #else