X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libbb%2Fget_console.c;h=9b6407bd022b0699d48368a2417c430650edf6b1;hb=4c46d854690595bb2c5487aedccebab8de8aafda;hp=d042afa2b52f3ba15c1102567553e07a028f3dbf;hpb=defc1ea34074e7882724c460260d307cdf981a70;p=oweals%2Fbusybox.git diff --git a/libbb/get_console.c b/libbb/get_console.c index d042afa2b..9b6407bd0 100644 --- a/libbb/get_console.c +++ b/libbb/get_console.c @@ -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 */ 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 */