changeset 1048:9899cb2199af

* sysdep.c (init_baud_rate): Re-arranged order of conditionals - test TERMIOS before TERMIO; when two options might both be defined, test the most recent first, so that the most recent functions get used. * sysdep.c [HAVE_TERMIO] (init_baud_rate): Don't use tcgetattr unless HAVE_TCATTR is defined. Only very rarely do termio systems have the tc{get,set}attr macros. * sysdep.c: #include "systty.h", not "systerm.h".
author Jim Blandy <jimb@redhat.com>
date Sat, 29 Aug 1992 03:07:24 +0000
parents 1ab1ed32e82a
children 25046e48ce9a
files src/sysdep.c
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/sysdep.c	Sat Aug 29 03:05:43 1992 +0000
+++ b/src/sysdep.c	Sat Aug 29 03:07:24 1992 +0000
@@ -102,7 +102,7 @@
 #endif /* DGUX */
 
 #include <sys/ioctl.h>
-#include "systerm.h"
+#include "systty.h"
 
 #ifdef BSD
 #ifdef BSD4_1
@@ -264,27 +264,31 @@
 		&sg.class, 12, 0, 0, 0, 0 );
       ospeed = sg.xmit_baud;
 #else /* not VMS */
-#ifdef HAVE_TERMIO
-      struct termio sg;
-
-      sg.c_cflag = (sg.c_cflag & ~CBAUD) | B9600;
-      tcgetattr (0, &sg);
-      ospeed = sg.c_cflag & CBAUD;
-#else /* neither VMS nor TERMIO */
 #ifdef HAVE_TERMIOS
       struct termios sg;
 
       sg.c_cflag = (sg.c_cflag & ~CBAUD) | B9600;
       tcgetattr (0, &sg);
       ospeed = sg.c_cflag & CBAUD;
-#else /* neither VMS nor TERMIO nor TERMIOS */
+#else /* neither VMS nor TERMIOS */
+#ifdef HAVE_TERMIO
+      struct termio sg;
+
+      sg.c_cflag = (sg.c_cflag & ~CBAUD) | B9600;
+#ifdef HAVE_TCATTR
+      tcgetattr (0, &sg);
+#else
+      ioctl (fd, TIOCGETP, &sg);
+#endif
+      ospeed = sg.c_cflag & CBAUD;
+#else /* neither VMS nor TERMIOS nor TERMIO */
       struct sgttyb sg;
       
       sg.sg_ospeed = B9600;
       ioctl (0, TIOCGETP, &sg);
       ospeed = sg.sg_ospeed;
+#endif /* not HAVE_TERMIO */
 #endif /* not HAVE_TERMIOS */
-#endif /* not HAVE_TERMIO */
 #endif /* not VMS */
     }