summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--sys.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index c3cd947..e9a5984 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,7 +38,7 @@ AC_CANONICAL_HOST
AC_CHECK_HEADERS([pty.h stropts.h sys/param.h sys/select.h])
-AC_CHECK_FUNCS([select grantpt])
+AC_CHECK_FUNCS([select grantpt posix_openpt])
AC_ARG_WITH(localealiasfile,
AS_HELP_STRING([--with-localealiasfile=<path>],
diff --git a/sys.c b/sys.c
index 804bdbb..8463b05 100644
--- a/sys.c
+++ b/sys.c
@@ -335,7 +335,11 @@ allocatePty(int *pty_return, char **line_return)
#if defined(HAVE_GRANTPT)
int rc;
+#ifdef HAVE_POSIX_OPENPT
+ pty = posix_openpt(O_RDWR);
+#else
pty = open("/dev/ptmx", O_RDWR);
+#endif
if (pty < 0)
goto bsd;