--- rxvt-unicode/src/ptytty.C 2007/12/11 21:49:12 1.68 +++ rxvt-unicode/src/ptytty.C 2010/07/21 08:46:13 1.70 @@ -25,7 +25,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *---------------------------------------------------------------------*/ -#include "../config.h" +#include "config.h" #include "ptytty.h" @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -43,7 +44,7 @@ #if defined(HAVE_DEV_PTMX) && defined(HAVE_SYS_STROPTS_H) # include /* for I_PUSH */ #endif -#ifdef HAVE_ISASTREAM +#if defined(HAVE_ISASTREAM) && defined(HAVE_STROPTS_H) # include #endif #if defined(HAVE_PTY_H) @@ -129,40 +130,9 @@ slave = _getpty (&pfd, O_RDWR | O_NONBLOCK | O_NOCTTY, 0622, 0); - if (slave != NULL) { - *ttydev = strdup (slave); - return pfd; - } - - return -1; - } - -#elif defined(HAVE_DEV_PTC) - - static int - get_pty (int *fd_tty, char **ttydev) - { - int pfd; - - if ((pfd = open ("/dev/ptc", O_RDWR | O_NOCTTY, 0)) >= 0) - { - *ttydev = strdup (ttyname (pfd)); - return pfd; - } - - return -1; - } - -#elif defined(HAVE_DEV_CLONE) - - static int - get_pty (int *fd_tty, char **ttydev) - { - int pfd; - - if ((pfd = open ("/dev/ptym/clone", O_RDWR | O_NOCTTY, 0)) >= 0) + if (slave != NULL) { - *ttydev = strdup (ptsname (pfd)); + *ttydev = strdup (slave); return pfd; } @@ -248,7 +218,7 @@ * close () - on the master side which causes a hang up to be sent * through - Geoff Wing */ -# ifdef HAVE_ISASTREAM +#if defined(HAVE_ISASTREAM) && defined(HAVE_STROPTS_H) if (isastream (fd_tty) == 1) # endif {