summaryrefslogtreecommitdiffstats
path: root/tdesu
diff options
context:
space:
mode:
Diffstat (limited to 'tdesu')
-rw-r--r--tdesu/tdesu_pty.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tdesu/tdesu_pty.cpp b/tdesu/tdesu_pty.cpp
index 207c0a3e2..4b01dde86 100644
--- a/tdesu/tdesu_pty.cpp
+++ b/tdesu/tdesu_pty.cpp
@@ -94,10 +94,14 @@ PTY::~PTY()
int PTY::getpt()
{
-#if defined(HAVE_GETPT) && defined(HAVE_PTSNAME)
+#if (defined(HAVE_GETPT) || defined(HAVE_POSIX_OPENPT)) && defined(HAVE_PTSNAME)
// 1: UNIX98: preferred way
+#ifdef HAVE_GETPT
ptyfd = ::getpt();
+#elif defined(HAVE_POSIX_OPENPT)
+ ptyfd = ::posix_openpt(O_RDWR);
+#endif
ttyname = ::ptsname(ptyfd);
return ptyfd;