mv: implement -n option
[oweals/busybox.git] / libbb / get_console.c
index d042afa2b52f3ba15c1102567553e07a028f3dbf..9b6407bd022b0699d48368a2417c430650edf6b1 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (C) many different people.  If you wrote this, please
  * acknowledge your work.
  *
- * 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"
@@ -13,7 +13,6 @@
 /* From <linux/kd.h> */
 enum { KDGKBTYPE = 0x4B33 };  /* get keyboard type */
 
-
 static int open_a_console(const char *fnam)
 {
        int fd;
@@ -37,8 +36,7 @@ static int open_a_console(const char *fnam)
  * We try several things because opening /dev/console will fail
  * if someone else used X (which does a chown on /dev/console).
  */
-
-int FAST_FUNC get_console_fd(void)
+int FAST_FUNC get_console_fd_or_die(void)
 {
        static const char *const console_names[] = {
                DEV_CONSOLE, CURRENT_VC, CURRENT_TTY
@@ -65,8 +63,8 @@ int FAST_FUNC get_console_fd(void)
                }
        }
 
-       bb_error_msg("can't open console");
-       return fd;                      /* total failure */
+       bb_error_msg_and_die("can't open console");
+       /*return fd; - total failure */
 }
 
 /* From <linux/vt.h> */