lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / loginutils / login.c
index 88ed0af7822400fab93afdcd29e427baa47454d0..e104fbb932d7e59beae2fdece0bbcc21e61fee5a 100644 (file)
@@ -1,6 +1,6 @@
 /* vi: set sw=4 ts=4: */
 /*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 #include "libbb.h"
 #include <syslog.h>
@@ -264,7 +264,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
 
        while (1) {
                /* flush away any type-ahead (as getty does) */
-               ioctl(0, TCFLSH, TCIFLUSH);
+               tcflush(0, TCIFLUSH);
 
                if (!username[0])
                        get_username_or_die(username, sizeof(username));