diff options
author | Richard M. Stallman <rms@gnu.org> | 1993-05-30 21:37:57 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1993-05-30 21:37:57 +0000 |
commit | e6cc3307516191803c1976fffbd6f4c6adf666e3 (patch) | |
tree | 2c9a5b8e80044ab9a51a0486e8d8eeb0261a2ff8 /src/sysdep.c | |
parent | 0aef856135a80b4ea461fa82469f9cd3629887fb (diff) | |
download | emacs-e6cc3307516191803c1976fffbd6f4c6adf666e3.tar.gz |
(child_setup_tty) [AIX SIGNALS_VIA_CHARACTERS]: Install
something usefull in the VQUIT and VINTR.
(emacs_set_tty): Try only 10 times to call tcsetattr.
Don't use memcmp to test what it did.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r-- | src/sysdep.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 167b9c398a9..16227ffb5b3 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -463,8 +463,20 @@ child_setup_tty (out) /* QUIT and INTR work better as signals, so disable character forms */ s.main.c_cc[VQUIT] = 0377; s.main.c_cc[VINTR] = 0377; - s.main.c_cc[VEOL] = 0377; +#ifdef SIGNALS_VIA_CHARACTERS + /* the QUIT and INTR character are used in process_send_signal + so set them here to something useful. */ + if (s.main.c_cc[VQUIT] == 0377) + s.main.c_cc[VQUIT] = '\\'&037; /* Control-\ */ + if (s.main.c_cc[VINTR] == 0377) + s.main.c_cc[VINTR] = 'C'&037; /* Control-C */ +#else /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */ + /* QUIT and INTR work better as signals, so disable character forms */ + s.main.c_cc[VQUIT] = 0377; + s.main.c_cc[VINTR] = 0377; s.main.c_lflag &= ~ISIG; +#endif /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */ + s.main.c_cc[VEOL] = 0377; s.main.c_cflag = (s.main.c_cflag & ~CBAUD) | B9600; /* baud rate sanity */ #endif /* AIX */ @@ -805,6 +817,7 @@ emacs_set_tty (fd, settings, waitp) { /* Set the primary parameters - baud rate, character size, etcetera. */ #ifdef HAVE_TCATTR + int i; /* We have those nifty POSIX tcmumbleattr functions. William J. Smith <wjs@wiis.wang.com> writes: "POSIX 1003.1 defines tcsetattr() to return success if it was @@ -812,7 +825,8 @@ emacs_set_tty (fd, settings, waitp) of the requested actions could not be performed. We must read settings back to ensure tty setup properly. AIX requires this to keep tty from hanging occasionally." */ - for (;;) + /* This make sure that we dont loop indefinetly in here. */ + for (i = 0 ; i < 10 ; i++) if (tcsetattr (fd, waitp ? TCSAFLUSH : TCSADRAIN, &settings->main) < 0) { if (errno == EINTR) @@ -826,10 +840,18 @@ emacs_set_tty (fd, settings, waitp) /* Get the current settings, and see if they're what we asked for. */ tcgetattr (fd, &new); - if (memcmp (&new, &settings->main, sizeof (new))) - continue; - else + /* We cannot use memcmp on the whole structure here because under + * aix386 the termios structure has some reserved field that may + * not be filled in. + */ + if ( new.c_iflag == settings->main.c_iflag + && new.c_oflag == settings->main.c_oflag + && new.c_cflag == settings->main.c_cflag + && new.c_lflag == settings->main.c_lflag + && memcmp(new.c_cc, settings->main.c_cc, NCCS) == 0) break; + else + continue; } #else |