summaryrefslogtreecommitdiff
path: root/libbb/get_console.c
diff options
context:
space:
mode:
authorDenis Vlasenko2007-02-17 15:52:02 +0000
committerDenis Vlasenko2007-02-17 15:52:02 +0000
commitec27feb04589d46233802f686559fb5f532fb2df (patch)
tree3c6f8dd683c840fd4855f86e6956db38ad9320bb /libbb/get_console.c
parentc84520d73dbe100449d84241ec0df9d02ee0fc4d (diff)
downloadbusybox-ec27feb04589d46233802f686559fb5f532fb2df.zip
busybox-ec27feb04589d46233802f686559fb5f532fb2df.tar.gz
init: code readability enhancements; very small code changes
Diffstat (limited to 'libbb/get_console.c')
-rw-r--r--libbb/get_console.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libbb/get_console.c b/libbb/get_console.c
index 62a1739..42ee137 100644
--- a/libbb/get_console.c
+++ b/libbb/get_console.c
@@ -8,15 +8,10 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
#include <sys/ioctl.h>
#include "libbb.h"
-
/* From <linux/kd.h> */
enum { KDGKBTYPE = 0x4B33 }; /* get keyboard type */
@@ -47,18 +42,18 @@ static int open_a_console(const char *fnam)
int get_console_fd(void)
{
- int fd;
-
- static const char * const choise_console_names[] = {
- CONSOLE_DEV, CURRENT_VC, CURRENT_TTY
+ static const char *const console_names[] = {
+ DEV_CONSOLE, CURRENT_VC, CURRENT_TTY
};
+ int fd;
+
for (fd = 2; fd >= 0; fd--) {
int fd4name;
int choise_fd;
char arg;
- fd4name = open_a_console(choise_console_names[fd]);
+ fd4name = open_a_console(console_names[fd]);
chk_std:
choise_fd = (fd4name >= 0 ? fd4name : fd);