This works around obscure bug both in linux tty. Bug is present in
BOTH 2.0.3X and 2.1.129. It can be reproduced by holding ^D on login
prompt on some machines (my 386, someones 486sx, someone reproduced
that on k6). Please apply.
Pavel
--- clean/drivers/char/tty_io.c Sat Nov 14 23:15:24 1998
+++ linux/drivers/char/tty_io.c Wed Nov 25 23:32:39 1998
@@ -868,7 +868,13 @@
* Failures after this point use release_mem to clean up, so
* there's no need to null out the local pointers.
*/
- driver->table[idx] = tty;
+ driver->table[idx] = tty; /* FIXME: this is broken and
+ probably causes ^D bug. tty->private_date does not (yet) point
+ to a console, if keypress comes now, await armagedon.
+
+ also, driver->table is accessed from interrupt for vt case,
+ and this does not look like atomic access at all. */
+
if (!*tp_loc)
*tp_loc = tp;
if (!*ltp_loc)
--- clean/drivers/char/keyboard.c Tue Aug 25 22:00:11 1998
+++ linux/drivers/char/keyboard.c Fri Nov 27 10:40:14 1998
@@ -123,5 +123,10 @@
add_keyboard_randomness(scancode);
- tty = ttytab? ttytab[fg_console]: NULL;
- kbd = kbd_table + fg_console;
+ tty = ttytab? ttytab[fg_console]: NULL;
+ if (tty && (!tty->driver_data)) {
+ /* This is to workaround ugly bug in tty_io.c, which
+ does not do locking when it should */
+ tty = NULL;
+ }
+ kbd = kbd_table + fg_console;
if ((raw_mode = (kbd->kbdmode == VC_RAW))) {
-- I'm really pavel@atrey.karlin.mff.cuni.cz. Pavel Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/