diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-17 15:52:02 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-17 15:52:02 +0000 |
commit | ec27feb04589d46233802f686559fb5f532fb2df (patch) | |
tree | 3c6f8dd683c840fd4855f86e6956db38ad9320bb /libbb | |
parent | c84520d73dbe100449d84241ec0df9d02ee0fc4d (diff) | |
download | busybox-ec27feb04589d46233802f686559fb5f532fb2df.tar.gz |
init: code readability enhancements; very small code changes
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/get_console.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libbb/get_console.c b/libbb/get_console.c index 62a17399d..42ee137b9 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); |