mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
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