From 0b577a7b6946300d0f7df8d546b16de06373f086 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 4 Feb 1996 16:14:07 +0000 Subject: [PATCH] ... git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@230 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/telnet/telnetd/telnetd.c | 26 ++++++++++++++++---------- appl/telnet/telnetd/termstat.c | 4 ++-- appl/telnet/telnetd/utility.c | 4 ++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/appl/telnet/telnetd/telnetd.c b/appl/telnet/telnetd/telnetd.c index d2daa0737..c70f915f4 100644 --- a/appl/telnet/telnetd/telnetd.c +++ b/appl/telnet/telnetd/telnetd.c @@ -79,12 +79,18 @@ int registerd_host_only = 0; #ifdef STREAMSPTY # include # include +#ifdef HAVE_SYS_UIO_H +#include +#endif /* HAVE_SYS_UIO_H */ #ifdef HAVE_SYS_STREAM_H #include #endif # ifdef HAVE_SYS_STRTTY_H # include # endif +# ifdef HAVE_SYS_STR_TTY_H +# include +# endif /* make sure we don't get the bsd version */ /* what is this here for? solaris? /joda */ # ifdef HAVE_SYS_TTY_H @@ -803,8 +809,8 @@ void doit(struct sockaddr_in *who) * Find an available pty to use. */ #ifndef convex - pty = getpty(&ptynum); - if (pty < 0) + ourpty = getpty(&ptynum); + if (ourpty < 0) fatal(net, "All network ports in use"); #else for (;;) { @@ -814,7 +820,7 @@ void doit(struct sockaddr_in *who) if ((lp = getpty()) == NULL) fatal(net, "Out of ptys"); - if ((pty = open(lp, 2)) >= 0) { + if ((ourpty = open(lp, 2)) >= 0) { strcpy(line,lp); line[5] = 't'; break; @@ -911,9 +917,9 @@ void doit(struct sockaddr_in *who) } #endif /* _SC_CRAY_SECURE_SYS */ - telnet(net, pty); /* begin server processing */ + telnet(net, ourpty); /* begin server processing */ #else - telnet(net, pty, host); + telnet(net, ourpty, host); #endif /*NOTREACHED*/ } /* end of doit */ @@ -1550,12 +1556,12 @@ interrupt() /* Streams PTY style ioctl to post a signal */ { int sig = SIGINT; - (void) ioctl(pty, TIOCSIGNAL, &sig); - (void) ioctl(pty, I_FLUSH, FLUSHR); + (void) ioctl(ourpty, TIOCSIGNAL, &sig); + (void) ioctl(ourpty, I_FLUSH, FLUSHR); } #else #ifdef TCSIG - (void) ioctl(pty, TCSIG, (char *)SIGINT); + (void) ioctl(ourpty, TCSIG, (char *)SIGINT); #else /* TCSIG */ init_termbuf(); *pfrontp++ = slctab[SLC_IP].sptr ? @@ -1574,7 +1580,7 @@ sendbrk() { ptyflush(); /* half-hearted */ #ifdef TCSIG - (void) ioctl(pty, TCSIG, (char *)SIGQUIT); + (void) ioctl(ourpty, TCSIG, (char *)SIGQUIT); #else /* TCSIG */ init_termbuf(); *pfrontp++ = slctab[SLC_ABORT].sptr ? @@ -1588,7 +1594,7 @@ sendsusp() #ifdef SIGTSTP ptyflush(); /* half-hearted */ # ifdef TCSIG - (void) ioctl(pty, TCSIG, (char *)SIGTSTP); + (void) ioctl(ourpty, TCSIG, (char *)SIGTSTP); # else /* TCSIG */ *pfrontp++ = slctab[SLC_SUSP].sptr ? (unsigned char)*slctab[SLC_SUSP].sptr : '\032'; diff --git a/appl/telnet/telnetd/termstat.c b/appl/telnet/telnetd/termstat.c index dede5e4fb..e4a71b16b 100644 --- a/appl/telnet/telnetd/termstat.c +++ b/appl/telnet/telnetd/termstat.c @@ -543,7 +543,7 @@ clientstat(code, parm1, parm2) ws.ws_col = parm1; ws.ws_row = parm2; - (void) ioctl(pty, TIOCSWINSZ, (char *)&ws); + (void) ioctl(ourpty, TIOCSWINSZ, (char *)&ws); } #endif /* TIOCSWINSZ */ @@ -635,7 +635,7 @@ defer_terminit() memset((char *)&ws, 0, sizeof(ws)); ws.ws_col = def_col; ws.ws_row = def_row; - (void) ioctl(pty, TIOCSWINSZ, (char *)&ws); + (void) ioctl(ourpty, TIOCSWINSZ, (char *)&ws); } #endif diff --git a/appl/telnet/telnetd/utility.c b/appl/telnet/telnetd/utility.c index 9e010a967..3d4f54853 100644 --- a/appl/telnet/telnetd/utility.c +++ b/appl/telnet/telnetd/utility.c @@ -101,7 +101,7 @@ stilloob(s) } while ((value == -1) && (errno == EINTR)); if (value < 0) { - fatalperror(pty, "select"); + fatalperror(ourpty, "select"); } if (FD_ISSET(s, &excepts)) { return 1; @@ -120,7 +120,7 @@ ptyflush() { sprintf(nfrontp, "td: ptyflush %d chars\r\n", n); nfrontp += strlen(nfrontp); }); DIAG(TD_PTYDATA, printdata("pd", pbackp, n)); - n = write(pty, pbackp, n); + n = write(ourpty, pbackp, n); } if (n < 0) { if (errno == EWOULDBLOCK || errno == EINTR)