aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'init.c')
-rw-r--r--init.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/init.c b/init.c
index a3e8d6700..f6e9eff97 100644
--- a/init.c
+++ b/init.c
@@ -41,7 +41,7 @@
#include <sys/vt.h> /* for vt_stat */
#include <sys/ioctl.h>
-#define VT_CONSOLE "/dev/console" /* Logical system console */
+#define DEV_CONSOLE "/dev/console" /* Logical system console */
#define VT_PRIMARY "/dev/tty1" /* Primary virtual console */
#define VT_SECONDARY "/dev/tty2" /* Virtual console */
#define VT_LOG "/dev/tty3" /* Virtual console */
@@ -53,7 +53,7 @@
#define LOG 0x1
#define CONSOLE 0x2
-static char *console = VT_CONSOLE;
+static char *console = DEV_CONSOLE;
static char *second_console = VT_SECONDARY;
static char *log = VT_LOG;
static int kernel_version = 0;
@@ -109,7 +109,8 @@ void message(int device, char *fmt, ...)
va_end(arguments);
}
if (device & CONSOLE) {
- if ((fd = device_open(console, O_WRONLY|O_NOCTTY|O_NDELAY)) >= 0) {
+ /* Always send console messages to /dev/console so people will see them. */
+ if ((fd = device_open(DEV_CONSOLE, O_WRONLY|O_NOCTTY|O_NDELAY)) >= 0) {
va_start(arguments, fmt);
vdprintf(fd, fmt, arguments);
va_end(arguments);
@@ -217,7 +218,7 @@ static void console_init()
/* this is linux virtual tty */
snprintf( the_console, sizeof the_console, "/dev/tty%d", vt.v_active );
} else {
- console = VT_CONSOLE;
+ console = DEV_CONSOLE;
tried_devcons++;
}
}
@@ -226,7 +227,7 @@ static void console_init()
/* Can't open selected console -- try /dev/console */
if (!tried_devcons) {
tried_devcons++;
- console = VT_CONSOLE;
+ console = DEV_CONSOLE;
continue;
}
/* Can't open selected console -- try vt1 */