--- linux/drivers/char/tty_io.c.1 Sat May 4 00:27:04 2002 +++ linux/drivers/char/tty_io.c Sat May 4 00:36:25 2002 @@ -189,10 +189,20 @@ _tty_make_name(struct tty_struct *tty, c if (!tty) /* Hmm. NULL pointer. That's fun. */ strcpy(buf, "NULL tty"); - else - sprintf(buf, name, - idx + tty->driver.name_base); - + else { + if (strchr(name, '%')) { + /* + * Assuming printf() style + * format strings are present... + */ + sprintf(buf, name, + idx + tty->driver.name_base); + } else { /* Old style... */ + sprintf(buf, "%s%d", name, + idx + tty->driver.name_base); + } + } + return buf; } @@ -2305,14 +2315,22 @@ void __init tty_init(void) #ifdef CONFIG_VT dev_console_driver = dev_tty_driver; +#ifdef CONFIG_DEVFS_FS dev_console_driver.driver_name = "/dev/vc/0"; +#else + dev_console_driver.driver_name = "/dev/tty0"; +#endif dev_console_driver.name = dev_console_driver.driver_name + 5; dev_console_driver.major = TTY_MAJOR; dev_console_driver.type = TTY_DRIVER_TYPE_SYSTEM; dev_console_driver.subtype = SYSTEM_TYPE_CONSOLE; if (tty_register_driver(&dev_console_driver)) +#ifdef CONFIG_DEVFS_FS + panic("Couldn't register /dev/vc/0 driver"); +#else panic("Couldn't register /dev/tty0 driver\n"); +#endif vcs_init(); kbd_init();