diff options
author | Andrew McGill | 2008-07-29 23:56:05 +0200 |
---|---|---|
committer | Karel Zak | 2008-08-05 12:39:01 +0200 |
commit | e8c7a57b4fafb16a4cbf535c8e07066b20ed9551 (patch) | |
tree | c4cbd712495490e4eccf1a133a6cae93299c1e15 /misc-utils/script.c | |
parent | Fix dmesg.1 installation (diff) | |
download | kernel-qcow2-util-linux-e8c7a57b4fafb16a4cbf535c8e07066b20ed9551.tar.gz kernel-qcow2-util-linux-e8c7a57b4fafb16a4cbf535c8e07066b20ed9551.tar.xz kernel-qcow2-util-linux-e8c7a57b4fafb16a4cbf535c8e07066b20ed9551.zip |
script: don't flush input when starting script
script currently flushed the input buffer when starting up. This undocumented
behaviour prevents typeahead when starting up (e.g. as part of .profile).
Rather retain queued input. Don't discard queued output either.
Signed-off-by: Andrew McGill <andrew@lunch.za.net>
Diffstat (limited to 'misc-utils/script.c')
-rw-r--r-- | misc-utils/script.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc-utils/script.c b/misc-utils/script.c index 45a9c3e79..12ea43a82 100644 --- a/misc-utils/script.c +++ b/misc-utils/script.c @@ -408,7 +408,7 @@ fixtty() { rtt = tt; cfmakeraw(&rtt); rtt.c_lflag &= ~ECHO; - (void) tcsetattr(0, TCSAFLUSH, &rtt); + (void) tcsetattr(0, TCSANOW, &rtt); } void @@ -432,7 +432,7 @@ done() { (void) fclose(fscript); (void) close(master); } else { - (void) tcsetattr(0, TCSAFLUSH, &tt); + (void) tcsetattr(0, TCSADRAIN, &tt); if (!qflg) printf(_("Script done, file is %s\n"), fname); } @@ -493,7 +493,7 @@ getslave() { perror(line); fail(); } - (void) tcsetattr(slave, TCSAFLUSH, &tt); + (void) tcsetattr(slave, TCSANOW, &tt); (void) ioctl(slave, TIOCSWINSZ, (char *)&win); #endif (void) setsid(); |