lineedit: do not hang on error, but return error indicator.
[oweals/busybox.git] / console-tools / kbd_mode.c
index 544bbb789485b017ab057bf42f8df29fd5d5647f..14f2ae516e701c56e7c6120c6a373fd1a0014500 100644 (file)
@@ -6,7 +6,7 @@
  *   written using Andries Brouwer <aeb@cwi.nl>'s kbd_mode from
  *   console-utils v0.2.3, licensed under GNU GPLv2
  *
- * 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 <linux/kd.h>
@@ -25,7 +25,7 @@ int kbd_mode_main(int argc UNUSED_PARAM, char **argv)
        const char *tty_name = CURRENT_TTY;
 
        opt = getopt32(argv, "sakuC:", &tty_name);
-       fd = xopen(tty_name, O_NONBLOCK);
+       fd = xopen_nonblocking(tty_name);
        opt &= 0xf; /* clear -C bit, see (*) */
 
        if (!opt) { /* print current setting */