Commit e6cc3307 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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.
parent 0aef8561
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment