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