git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@230 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-02-04 16:14:07 +00:00
parent e2822ca2a9
commit 0b577a7b69
3 changed files with 20 additions and 14 deletions

View File

@@ -79,12 +79,18 @@ int registerd_host_only = 0;
#ifdef STREAMSPTY
# include <stropts.h>
# include <termios.h>
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif /* HAVE_SYS_UIO_H */
#ifdef HAVE_SYS_STREAM_H
#include <sys/stream.h>
#endif
# ifdef HAVE_SYS_STRTTY_H
# include <sys/strtty.h>
# endif
# ifdef HAVE_SYS_STR_TTY_H
# include <sys/str_tty.h>
# 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';

View File

@@ -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

View File

@@ -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)