diff options
author | Paul Fox <pgf@brightstareng.com> | 2007-11-07 15:51:35 +0000 |
---|---|---|
committer | Paul Fox <pgf@brightstareng.com> | 2007-11-07 15:51:35 +0000 |
commit | 6e1b62b18ccc928cfa5ff62eb7030b3e5543c15d (patch) | |
tree | cb3e645ec670af526035a438cb2fb1091622708d /loginutils | |
parent | a29a5e40aeb7af722f5245d5a106a86da5ae0d27 (diff) | |
download | busybox-6e1b62b18ccc928cfa5ff62eb7030b3e5543c15d.tar.gz |
flush typeahead before prompt
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/login.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/loginutils/login.c b/loginutils/login.c index ef27c3b4a..c1e0c7699 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -305,6 +305,10 @@ int login_main(int argc, char **argv) openlog(applet_name, LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH); while (1) { + + /* flush away any type-ahead (as getty does) */ + (void) ioctl(0, TCFLSH, TCIFLUSH); + if (!username[0]) get_username_or_die(username, sizeof(username)); |