summaryrefslogtreecommitdiff
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1992-08-29 03:07:24 +0000
committerJim Blandy <jimb@redhat.com>1992-08-29 03:07:24 +0000
commite04a4e0dcf11972ab406026746e70e6be8e788f4 (patch)
tree0c014ed660ea45b0af1a6912604599f307bb5a8f /src/sysdep.c
parent36ebaafa99b6c6f2268b45f3d433a26ea3459657 (diff)
downloademacs-e04a4e0dcf11972ab406026746e70e6be8e788f4.tar.gz
* 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".
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index a14edc644e0..daaf19cc994 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -102,7 +102,7 @@ extern char *sys_errlist[];
#endif /* DGUX */
#include <sys/ioctl.h>
-#include "systerm.h"
+#include "systty.h"
#ifdef BSD
#ifdef BSD4_1
@@ -264,27 +264,31 @@ init_baud_rate ()
&sg.class, 12, 0, 0, 0, 0 );
ospeed = sg.xmit_baud;
#else /* not VMS */
-#ifdef HAVE_TERMIO
- struct termio sg;
+#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 */
-#ifdef HAVE_TERMIOS
- struct termios sg;
+#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 TERMIO nor TERMIOS */
+#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_TERMIOS */
#endif /* not HAVE_TERMIO */
+#endif /* not HAVE_TERMIOS */
#endif /* not VMS */
}