Fix bug reported by Chris Torek: use TCSADRAIN instead of TCSANOW, to avoid

dropping characters.
This commit is contained in:
christos 1996-11-08 19:34:37 +00:00
parent 976b43fd61
commit 0805134891
1 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: file.c,v 1.10 1995/03/21 18:35:39 mycroft Exp $ */
/* $NetBSD: file.c,v 1.11 1996/11/08 19:34:37 christos Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)file.c 8.2 (Berkeley) 3/19/94";
#else
static char rcsid[] = "$NetBSD: file.c,v 1.10 1995/03/21 18:35:39 mycroft Exp $";
static char rcsid[] = "$NetBSD: file.c,v 1.11 1996/11/08 19:34:37 christos Exp $";
#endif
#endif /* not lint */
@ -153,9 +153,9 @@ back_to_col_1()
tty_normal = tty;
tty.c_iflag &= ~INLCR;
tty.c_oflag &= ~ONLCR;
(void) tcsetattr(SHOUT, TCSANOW, &tty);
(void) tcsetattr(SHOUT, TCSADRAIN, &tty);
(void) write(SHOUT, "\r", 1);
(void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
(void) tcsetattr(SHOUT, TCSADRAIN, &tty_normal);
sigprocmask(SIG_SETMASK, &osigset, NULL);
}
@ -177,11 +177,11 @@ pushback(string)
(void) tcgetattr(SHOUT, &tty);
tty_normal = tty;
tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL);
(void) tcsetattr(SHOUT, TCSANOW, &tty);
(void) tcsetattr(SHOUT, TCSADRAIN, &tty);
for (p = string; (c = *p) != '\0'; p++)
(void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
(void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
(void) tcsetattr(SHOUT, TCSADRAIN, &tty_normal);
sigprocmask(SIG_SETMASK, &osigset, NULL);
}
@ -332,7 +332,7 @@ retype()
(void) tcgetattr(SHOUT, &tty);
tty.c_lflag |= PENDIN;
(void) tcsetattr(SHOUT, TCSANOW, &tty);
(void) tcsetattr(SHOUT, TCSADRAIN, &tty);
}
static void