From 6e1b62b18ccc928cfa5ff62eb7030b3e5543c15d Mon Sep 17 00:00:00 2001 From: Paul Fox Date: Wed, 7 Nov 2007 15:51:35 +0000 Subject: flush typeahead before prompt --- loginutils/login.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loginutils/login.c b/loginutils/login.c index ef27c3b..c1e0c76 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)); -- cgit v1.1