Mercurial > emacs
changeset 3157:84825e357019
* systty.h (HAVE_LTCHARS, HAVE_TCHARS): New macros; define them if
we have those structures, but *don't* define them if we have
TERMIOS, whose functions take care of those parameters; that
screws up AIX.
(struct emacs_tty): Test those symbols, instead of the ioctl
commands.
* sysdep.c (emacs_get_tty, emacs_set_tty, new_ltchars, new_tchars,
init_sys_modes): Same.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Thu, 27 May 1993 02:12:20 +0000 |
parents | ec142b6ddb34 |
children | 665ae1c5c3b3 |
files | src/sysdep.c src/systty.h |
diffstat | 2 files changed, 29 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sysdep.c Thu May 27 02:08:14 1993 +0000 +++ b/src/sysdep.c Thu May 27 02:12:20 1993 +0000 @@ -765,13 +765,13 @@ #endif /* Suivant - Do we have to get struct ltchars data? */ -#ifdef TIOCGLTC +#ifdef HAVE_LTCHARS if (ioctl (fd, TIOCGLTC, &settings->ltchars) < 0) return -1; #endif /* How about a struct tchars and a wordful of lmode bits? */ -#ifdef TIOCGETC +#ifdef HAVE_TCHARS if (ioctl (fd, TIOCGETC, &settings->tchars) < 0 || ioctl (fd, TIOCLGET, &settings->lmode) < 0) return -1; @@ -846,13 +846,13 @@ #endif /* Suivant - Do we have to get struct ltchars data? */ -#ifdef TIOCGLTC +#ifdef HAVE_LTCHARS if (ioctl (fd, TIOCSLTC, &settings->ltchars) < 0) return -1; #endif /* How about a struct tchars and a wordful of lmode bits? */ -#ifdef TIOCGETC +#ifdef HAVE_TCHARS if (ioctl (fd, TIOCSETC, &settings->tchars) < 0 || ioctl (fd, TIOCLSET, &settings->lmode) < 0) return -1; @@ -888,10 +888,10 @@ char _sobuf[BUFSIZ]; #endif -#ifdef TIOCGLTC +#ifdef HAVE_LTCHARS static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1}; #endif -#ifdef TIOCGETC +#ifdef HAVE_TCHARS static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1}; #endif @@ -1042,7 +1042,7 @@ control for user coming over network on 4.2; in this case, only t_stopc and t_startc really matter. */ #ifndef HAVE_TERMIO -#ifdef TIOCGETC +#ifdef HAVE_TCHARS /* Note: if not using CBREAK mode, it makes no difference how we set this */ tty.tchars = new_tchars; @@ -1068,12 +1068,12 @@ lmode = tty.lmode; #endif -#endif /* TIOCGETC */ +#endif /* HAVE_TCHARS */ #endif /* not HAVE_TERMIO */ -#ifdef TIOCGLTC +#ifdef HAVE_LTCHARS tty.ltchars = new_ltchars; -#endif /* TIOCGLTC */ +#endif /* HAVE_LTCHARS */ EMACS_SET_TTY (input_fd, &tty, 0);
--- a/src/systty.h Thu May 27 02:08:14 1993 +0000 +++ b/src/systty.h Thu May 27 02:12:20 1993 +0000 @@ -157,6 +157,17 @@ #undef SIGIO #endif +/* On TERMIOS systems, the tcmumbleattr calls take care of these + parameters, and it's a bad idea to use them (on AIX, it makes the + tty hang for a long time). +#if defined (TIOCGLTC) && !defined (HAVE_TERMIOS) +#define HAVE_LTCHARS +#endif + +#if defined (TIOCGETC) && !defined (HAVE_TERMIOS) +#define HAVE_TCHARS +#endif + /* Try to establish the correct character to disable terminal functions in a system-independent manner. Note that USG (at least) define @@ -286,13 +297,19 @@ #endif #endif #endif -#ifdef TIOCGLTC + +/* If we have TERMIOS, we don't need to do this - they're taken care of + by the tc*attr calls. */ +#ifndef HAVE_TERMIOS +#ifdef HAVE_LTCHARS struct ltchars ltchars; #endif -#ifdef TIOCGETC + +#ifdef HAVE_TCHARS struct tchars tchars; int lmode; #endif +#endif }; /* Define EMACS_GET_TTY and EMACS_SET_TTY,