aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-08-29 03:07:24 +0000
committerJim Blandy1992-08-29 03:07:24 +0000
commite04a4e0dcf11972ab406026746e70e6be8e788f4 (patch)
tree0c014ed660ea45b0af1a6912604599f307bb5a8f /src
parent36ebaafa99b6c6f2268b45f3d433a26ea3459657 (diff)
downloademacs-e04a4e0dcf11972ab406026746e70e6be8e788f4.tar.gz
emacs-e04a4e0dcf11972ab406026746e70e6be8e788f4.zip
* 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')
-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[];
102#endif /* DGUX */ 102#endif /* DGUX */
103 103
104#include <sys/ioctl.h> 104#include <sys/ioctl.h>
105#include "systerm.h" 105#include "systty.h"
106 106
107#ifdef BSD 107#ifdef BSD
108#ifdef BSD4_1 108#ifdef BSD4_1
@@ -264,27 +264,31 @@ init_baud_rate ()
264 &sg.class, 12, 0, 0, 0, 0 ); 264 &sg.class, 12, 0, 0, 0, 0 );
265 ospeed = sg.xmit_baud; 265 ospeed = sg.xmit_baud;
266#else /* not VMS */ 266#else /* not VMS */
267#ifdef HAVE_TERMIO 267#ifdef HAVE_TERMIOS
268 struct termio sg; 268 struct termios sg;
269 269
270 sg.c_cflag = (sg.c_cflag & ~CBAUD) | B9600; 270 sg.c_cflag = (sg.c_cflag & ~CBAUD) | B9600;
271 tcgetattr (0, &sg); 271 tcgetattr (0, &sg);
272 ospeed = sg.c_cflag & CBAUD; 272 ospeed = sg.c_cflag & CBAUD;
273#else /* neither VMS nor TERMIO */ 273#else /* neither VMS nor TERMIOS */
274#ifdef HAVE_TERMIOS 274#ifdef HAVE_TERMIO
275 struct termios sg; 275 struct termio sg;
276 276
277 sg.c_cflag = (sg.c_cflag & ~CBAUD) | B9600; 277 sg.c_cflag = (sg.c_cflag & ~CBAUD) | B9600;
278#ifdef HAVE_TCATTR
278 tcgetattr (0, &sg); 279 tcgetattr (0, &sg);
280#else
281 ioctl (fd, TIOCGETP, &sg);
282#endif
279 ospeed = sg.c_cflag & CBAUD; 283 ospeed = sg.c_cflag & CBAUD;
280#else /* neither VMS nor TERMIO nor TERMIOS */ 284#else /* neither VMS nor TERMIOS nor TERMIO */
281 struct sgttyb sg; 285 struct sgttyb sg;
282 286
283 sg.sg_ospeed = B9600; 287 sg.sg_ospeed = B9600;
284 ioctl (0, TIOCGETP, &sg); 288 ioctl (0, TIOCGETP, &sg);
285 ospeed = sg.sg_ospeed; 289 ospeed = sg.sg_ospeed;
286#endif /* not HAVE_TERMIOS */
287#endif /* not HAVE_TERMIO */ 290#endif /* not HAVE_TERMIO */
291#endif /* not HAVE_TERMIOS */
288#endif /* not VMS */ 292#endif /* not VMS */
289 } 293 }
290 294