diff --git a/appl/telnet/configure.in b/appl/telnet/configure.in index 7447de745..642e8e69f 100644 --- a/appl/telnet/configure.in +++ b/appl/telnet/configure.in @@ -281,12 +281,18 @@ AC_CHECK_HEADERS(sys/tty.h termio.h termios.h utmpx.h sys/uio.h) # Simple test for streamspty, based on the existance of getmsg(), alas # this breaks on SunOS4 which have streams but BSD-like ptys +# +# And also something wierd has happend with dec-osf1, fallback to bsd-ptys AC_MSG_CHECKING(for streamspty) -krb_cv_sys_streamspty="no" -if expr "`uname -sr`" : "SunOS 4" > /dev/null; then :; else +case "`uname -sr`" in +SunOS\ 4*|OSF1*) + krb_cv_sys_streamspty=no + ;; +*) krb_cv_sys_streamspty="$ac_cv_func_getmsg" -fi + ;; +esac if test "$krb_cv_sys_streamspty" = yes; then AC_DEFINE(STREAMSPTY) fi diff --git a/appl/telnet/telnetd/sys_term.c b/appl/telnet/telnetd/sys_term.c index 128b615ec..cf37f38e4 100644 --- a/appl/telnet/telnetd/sys_term.c +++ b/appl/telnet/telnetd/sys_term.c @@ -374,6 +374,16 @@ static char *ptsname(int fd) int getpty(int *ptynum) { +#ifdef __osf__ + int master; + int slave; + if(openpty(&master, &slave, line, 0, 0) == 0){ + close(slave); + return master; + } + return -1; +#else + int p; char *cp, *p1, *p2; int i; @@ -495,6 +505,7 @@ int getpty(int *ptynum) #endif /* STREAMSPTY */ #endif /* OPENPTY */ return(-1); +#endif } #ifdef LINEMODE @@ -877,7 +888,7 @@ static int my_find(int fd, char *module) sl.sl_modlist=(struct str_mlist*)malloc(n * sizeof(struct str_mlist)); sl.sl_nmods = n; n = ioctl(fd, I_LIST, &sl); - if(n != 0){ + if(n < 0){ perror("ioctl(fd, I_LIST, n)"); return -1; }