# HG changeset patch # User Jim Blandy # Date 715057644 0 # Node ID 9899cb2199afee804357e4c08eaf564550fbd5b8 # Parent 1ab1ed32e82acb99b6ca3d2d812c61e44683394b * 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". diff -r 1ab1ed32e82a -r 9899cb2199af src/sysdep.c --- 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 -#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 */ }