From ec27feb04589d46233802f686559fb5f532fb2df Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 17 Feb 2007 15:52:02 +0000 Subject: init: code readability enhancements; very small code changes --- libbb/get_console.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'libbb/get_console.c') 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 -#include -#include -#include #include #include "libbb.h" - /* From */ 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); -- cgit v1.2.3