[1277] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

krb5b4pl3: appl/telnet/telnet: struct termio vs. struct termios

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Fri Mar 24 14:32:46 1995

From: "Jonathan I. Kamens" <jik@cam.ov.com>
Date: Fri, 24 Mar 1995 14:35:07 -0500
To: krb5-bugs@MIT.EDU

The code in appl/telnet/telnet shows some confusion between when
struct termio and when struct termios should be used.  Here are
patches:

--- commands.c	1995/03/24 19:25:33	1.1
+++ commands.c	1995/03/24 19:26:59
@@ -852,7 +852,7 @@
  */
 
 #ifdef	USE_TERMIO
-struct termio new_tc = { 0 };
+STRUCT_TERMIO new_tc = { 0 };
 #endif
 
 struct setlist {
--- externs.h	1995/03/24 19:26:22	1.1
+++ externs.h	1995/03/24 19:33:31
@@ -81,6 +81,12 @@
 # endif
 #endif
 
+#ifdef TCSANOW
+#define STRUCT_TERMIO struct termios
+#else
+#define STRUCT_TERMIO struct termio
+#endif
+
 #ifndef	NO_STRING_H
 #include <string.h>
 #else
@@ -348,7 +354,7 @@
 
 # else
 
-extern struct	termio new_tc;
+extern STRUCT_TERMIO new_tc;
 
 # define termEofChar		new_tc.c_cc[VEOF]
 # define termEraseChar		new_tc.c_cc[VERASE]
--- sys_bsd.c	1995/03/24 19:20:25	1.1
+++ sys_bsd.c	1995/03/24 19:35:13
@@ -83,8 +83,6 @@
 # define old_tc ottyb
 
 #else	/* USE_TERMIO */
-struct	termio old_tc = { 0 };
-extern struct termio new_tc;
 
 # ifndef	TCSANOW
 #  ifdef TCSETS
@@ -115,6 +113,8 @@
 # endif
 #endif	/* USE_TERMIO */
 
+STRUCT_TERMIO old_tc = { 0 };
+extern STRUCT_TERMIO new_tc;
 static fd_set ibits, obits, xbits;
 
 
@@ -395,7 +395,7 @@
     struct sgttyb sb;
     int lmode;
 #else	/* USE_TERMIO */
-    struct termio tmp_tc;
+    STRUCT_TERMIO tmp_tc;
 #endif	/* USE_TERMIO */
     int onoff;
     int old;

home help back first fref pref prev next nref lref last post