flush typeahead before prompt

This commit is contained in:
Paul Fox 2007-11-07 15:51:35 +00:00
parent a29a5e40ae
commit 6e1b62b18c

View File

@ -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));