+2001-01-12 Sam Hartman <hartmans@mit.edu>
+
+ * krlogin.c: Previously, we only used TIOCGLTC on systems with
+ termios. This is sort of silly since its a BSD 4.[23] IOCTL. We
+ then go out of our way not to use it on IRIX, Solaris or HPUX. I
+ think all this comes about because you really want to use BSD
+ IOCTLS on Sunos rather than termios. I propose to do that and
+ never use BSD IOCTLs on Sunos.
+
+
2000-12-15 Ken Raeburn <raeburn@mit.edu>
* krlogin.c (main): Add new "-4" option, to use krb4
#endif
#endif
-/* how do we tell apart irix 5 and irix 4? */
-#if defined(__sgi) && defined(__mips)
-/* IRIX 5: TIOCGLTC doesn't actually work */
-#undef TIOCGLTC
-#endif
-
#ifndef TIOCPKT_NOSTOP
/* These values are over-the-wire protocol, *not* local values */
#define TIOCPKT_NOSTOP 0x10
};
#endif
+
+#ifndef POSIX_TERMIOS
#ifdef TIOCGLTC
/*
* POSIX 1003.1-1988 does not define a 'suspend' character.
struct ltchars defltc;
struct ltchars noltc = { -1, -1, -1, -1, -1, -1 };
#endif
-
-#ifndef POSIX_TERMIOS
struct tchars deftc;
struct tchars notc = { -1, -1, -1, -1, -1, -1 };
-#ifndef TIOCGLTC
-struct ltchars defltc;
-struct ltchars noltc = { -1, -1, -1, -1, -1, -1 };
-#endif
#endif
doit(oldmask)
/* there's a POSIX way of doing this, but do we need it general? */
deftty.c_cc[VLNEXT] = 0;
#endif
-#ifdef TIOCGLTC
- (void) ioctl(0, TIOCGLTC, (char *)&defltc);
-#endif
#else
#ifdef USE_TERMIO
struct termio sb;
}
}
-#ifdef TIOCGLTC
- if ((c == defltc.t_suspc || c == defltc.t_dsuspc)
- && !no_local_escape) {
- echo(c);
- stop(c);
- continue;
- }
-#else
#ifdef POSIX_TERMIOS
if ( (
(c == deftty.c_cc[VSUSP])
stop(c);
continue;
}
+#else /*POSIX_TERMIOS*/
+#ifdef TIOCGLTC
+ if ((c == defltc.t_suspc || c == defltc.t_dsuspc)
+ && !no_local_escape) {
+ echo(c);
+ stop(c);
+ continue;
+ }
+#endif /*TIOCGLTC*/
#endif
-#endif
+
if (c != cmdchar) {
rcmd_stream_write(rem, &cmdchar, 1, 0);
bol = (c == deftty.c_cc[VKILL] ||
c == deftty.c_cc[VINTR] ||
c == '\r' || c == '\n');
-#ifdef TIOCGLTC
- if (!bol)
- bol = (c == defltc.t_suspc);
-#endif
#else /* !POSIX_TERMIOS */
bol = c == defkill || c == deftc.t_eofc ||
(void) signal(SIGCHLD, SIG_IGN);
#endif
-#ifdef TIOCGLTC
- (void) kill(cmdc == defltc.t_suspc ? 0 : getpid(), SIGTSTP);
-#else
#ifdef POSIX_TERMIOS
(void) kill(cmdc == deftty.c_cc[VSUSP] ? 0 : getpid(), SIGTSTP);
+#else
+#ifdef TIOCGLTC
+ (void) kill(cmdc == defltc.t_suspc ? 0 : getpid(), SIGTSTP);
#endif
#endif
-
#ifdef POSIX_SIGNALS
sa.sa_handler = catchild;
(void) sigaction(SIGCHLD, &sa, (struct sigaction *)0);
switch(f) {
case 0:
-#ifdef TIOCGLTC
-#if !defined(sun)
- (void) ioctl(0, TIOCSLTC, (char *)&defltc);
-#endif
-#endif
(void) tcsetattr(0, TCSADRAIN, &deftty);
break;
case 1:
newtty.c_cc[VMIN] = 1;
newtty.c_cc[VTIME] = 0;
(void) tcsetattr(0, TCSADRAIN, &newtty);
-#ifdef TIOCGLTC
- /* Do this after the tcsetattr() in case this version
- * of termio supports the VSUSP or VDSUSP characters */
-#if !defined(sun)
- /* this forces ICRNL under Solaris... */
- (void) ioctl(0, TIOCSLTC, (char *)&noltc);
-#endif
-#endif
break;
default:
return;