$OpenBSD: patch-src_command_c,v 1.1 2012/12/17 18:37:59 naddy Exp $
--- src/command.c.orig	Thu Dec 13 21:00:06 2012
+++ src/command.c	Thu Dec 13 21:03:35 2012
@@ -1386,7 +1386,7 @@ sco_get_pty(void)
 }
 #endif
 
-#ifdef HAVE_DEV_PTMX
+#if defined(HAVE_POSIX_PTYS) || defined(HAVE_DEV_PTMX)
 inline int svr_get_pty(void);
 
 inline int
@@ -1395,8 +1395,12 @@ svr_get_pty(void)
 
     int fd = -1;
 
+#ifdef HAVE_POSIX_PTYS
+    if ((fd = posix_openpt(O_RDWR|O_NOCTTY)) < 0) {
+#else
     /* open the STREAMS, clone device /dev/ptmx (master pty) */
     if ((fd = open("/dev/ptmx", O_RDWR)) < 0) {
+#endif
         return (-1);
     } else {
         if (grantpt(fd) != 0) {
@@ -1459,7 +1463,7 @@ get_pty(void)
     fd = sgi_get_pty();
 #elif defined(HAVE_DEV_PTC)
     fd = aix_get_pty();
-#elif defined(HAVE_DEV_PTMX)
+#elif defined(HAVE_POSIX_PTYS) || defined(HAVE_DEV_PTMX)
     fd = svr_get_pty();
 #elif defined(HAVE_SCO_PTYS)
     fd = sco_get_pty();
