flush typeahead before prompt
This commit is contained in:
parent
a29a5e40ae
commit
6e1b62b18c
@ -305,6 +305,10 @@ int login_main(int argc, char **argv)
|
|||||||
openlog(applet_name, LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH);
|
openlog(applet_name, LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
||||||
|
/* flush away any type-ahead (as getty does) */
|
||||||
|
(void) ioctl(0, TCFLSH, TCIFLUSH);
|
||||||
|
|
||||||
if (!username[0])
|
if (!username[0])
|
||||||
get_username_or_die(username, sizeof(username));
|
get_username_or_die(username, sizeof(username));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user