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 #ifdef STREAMSPTY
# include <stropts.h> # include <stropts.h>
# include <termios.h> # include <termios.h>
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif /* HAVE_SYS_UIO_H */
#ifdef HAVE_SYS_STREAM_H #ifdef HAVE_SYS_STREAM_H
#include <sys/stream.h> #include <sys/stream.h>
#endif #endif
# ifdef HAVE_SYS_STRTTY_H # ifdef HAVE_SYS_STRTTY_H
# include <sys/strtty.h> # include <sys/strtty.h>
# endif # endif
# ifdef HAVE_SYS_STR_TTY_H
# include <sys/str_tty.h>
# endif
/* make sure we don't get the bsd version */ /* make sure we don't get the bsd version */
/* what is this here for? solaris? /joda */ /* what is this here for? solaris? /joda */
# ifdef HAVE_SYS_TTY_H # ifdef HAVE_SYS_TTY_H
@@ -803,8 +809,8 @@ void doit(struct sockaddr_in *who)
* Find an available pty to use. * Find an available pty to use.
*/ */
#ifndef convex #ifndef convex
pty = getpty(&ptynum); ourpty = getpty(&ptynum);
if (pty < 0) if (ourpty < 0)
fatal(net, "All network ports in use"); fatal(net, "All network ports in use");
#else #else
for (;;) { for (;;) {
@@ -814,7 +820,7 @@ void doit(struct sockaddr_in *who)
if ((lp = getpty()) == NULL) if ((lp = getpty()) == NULL)
fatal(net, "Out of ptys"); fatal(net, "Out of ptys");
if ((pty = open(lp, 2)) >= 0) { if ((ourpty = open(lp, 2)) >= 0) {
strcpy(line,lp); strcpy(line,lp);
line[5] = 't'; line[5] = 't';
break; break;
@@ -911,9 +917,9 @@ void doit(struct sockaddr_in *who)
} }
#endif /* _SC_CRAY_SECURE_SYS */ #endif /* _SC_CRAY_SECURE_SYS */
telnet(net, pty); /* begin server processing */ telnet(net, ourpty); /* begin server processing */
#else #else
telnet(net, pty, host); telnet(net, ourpty, host);
#endif #endif
/*NOTREACHED*/ /*NOTREACHED*/
} /* end of doit */ } /* end of doit */
@@ -1550,12 +1556,12 @@ interrupt()
/* Streams PTY style ioctl to post a signal */ /* Streams PTY style ioctl to post a signal */
{ {
int sig = SIGINT; int sig = SIGINT;
(void) ioctl(pty, TIOCSIGNAL, &sig); (void) ioctl(ourpty, TIOCSIGNAL, &sig);
(void) ioctl(pty, I_FLUSH, FLUSHR); (void) ioctl(ourpty, I_FLUSH, FLUSHR);
} }
#else #else
#ifdef TCSIG #ifdef TCSIG
(void) ioctl(pty, TCSIG, (char *)SIGINT); (void) ioctl(ourpty, TCSIG, (char *)SIGINT);
#else /* TCSIG */ #else /* TCSIG */
init_termbuf(); init_termbuf();
*pfrontp++ = slctab[SLC_IP].sptr ? *pfrontp++ = slctab[SLC_IP].sptr ?
@@ -1574,7 +1580,7 @@ sendbrk()
{ {
ptyflush(); /* half-hearted */ ptyflush(); /* half-hearted */
#ifdef TCSIG #ifdef TCSIG
(void) ioctl(pty, TCSIG, (char *)SIGQUIT); (void) ioctl(ourpty, TCSIG, (char *)SIGQUIT);
#else /* TCSIG */ #else /* TCSIG */
init_termbuf(); init_termbuf();
*pfrontp++ = slctab[SLC_ABORT].sptr ? *pfrontp++ = slctab[SLC_ABORT].sptr ?
@@ -1588,7 +1594,7 @@ sendsusp()
#ifdef SIGTSTP #ifdef SIGTSTP
ptyflush(); /* half-hearted */ ptyflush(); /* half-hearted */
# ifdef TCSIG # ifdef TCSIG
(void) ioctl(pty, TCSIG, (char *)SIGTSTP); (void) ioctl(ourpty, TCSIG, (char *)SIGTSTP);
# else /* TCSIG */ # else /* TCSIG */
*pfrontp++ = slctab[SLC_SUSP].sptr ? *pfrontp++ = slctab[SLC_SUSP].sptr ?
(unsigned char)*slctab[SLC_SUSP].sptr : '\032'; (unsigned char)*slctab[SLC_SUSP].sptr : '\032';

View File

@@ -543,7 +543,7 @@ clientstat(code, parm1, parm2)
ws.ws_col = parm1; ws.ws_col = parm1;
ws.ws_row = parm2; ws.ws_row = parm2;
(void) ioctl(pty, TIOCSWINSZ, (char *)&ws); (void) ioctl(ourpty, TIOCSWINSZ, (char *)&ws);
} }
#endif /* TIOCSWINSZ */ #endif /* TIOCSWINSZ */
@@ -635,7 +635,7 @@ defer_terminit()
memset((char *)&ws, 0, sizeof(ws)); memset((char *)&ws, 0, sizeof(ws));
ws.ws_col = def_col; ws.ws_col = def_col;
ws.ws_row = def_row; ws.ws_row = def_row;
(void) ioctl(pty, TIOCSWINSZ, (char *)&ws); (void) ioctl(ourpty, TIOCSWINSZ, (char *)&ws);
} }
#endif #endif

View File

@@ -101,7 +101,7 @@ stilloob(s)
} while ((value == -1) && (errno == EINTR)); } while ((value == -1) && (errno == EINTR));
if (value < 0) { if (value < 0) {
fatalperror(pty, "select"); fatalperror(ourpty, "select");
} }
if (FD_ISSET(s, &excepts)) { if (FD_ISSET(s, &excepts)) {
return 1; return 1;
@@ -120,7 +120,7 @@ ptyflush()
{ sprintf(nfrontp, "td: ptyflush %d chars\r\n", n); { sprintf(nfrontp, "td: ptyflush %d chars\r\n", n);
nfrontp += strlen(nfrontp); }); nfrontp += strlen(nfrontp); });
DIAG(TD_PTYDATA, printdata("pd", pbackp, n)); DIAG(TD_PTYDATA, printdata("pd", pbackp, n));
n = write(pty, pbackp, n); n = write(ourpty, pbackp, n);
} }
if (n < 0) { if (n < 0) {
if (errno == EWOULDBLOCK || errno == EINTR) if (errno == EWOULDBLOCK || errno == EINTR)