diff --git a/lib/roken/rkpty.c b/lib/roken/rkpty.c index 16b10c808..f93d9e746 100644 --- a/lib/roken/rkpty.c +++ b/lib/roken/rkpty.c @@ -50,25 +50,7 @@ #endif #ifdef STREAMSPTY -#ifdef HAVE_SAC_H -#include -#endif -#ifdef HAVE_SYS_STROPTS_H -#include -#endif - -# include - -#ifdef HAVE_SYS_UIO_H -#include -#ifdef __hpux -#undef SE -#endif -#endif - -#ifdef HAVE_SYS_STREAM_H -#include -#endif +#include #endif /* STREAMPTY */ #include "roken.h" @@ -121,9 +103,8 @@ open_pty(void) "/dev/ptym/clone", NULL }; - char **q; - int p; + for(q = clone; *q; q++){ master = open(*q, O_RDWR); if(master >= 0){ @@ -136,9 +117,11 @@ open_pty(void) strlcpy(line, ptsname(master), sizeof(line)); slave = open(line, O_RDWR); if (slave < 0) - errx(1, "failed to open slave"); + errx(1, "failed to open slave when using %s", q); ioctl(slave, I_PUSH, "ptem"); ioctl(slave, I_PUSH, "ldterm"); + + return; } } }