Bug when opening /dev/ptmx with CONFIG_UNIX98_PTYS undefined

tytso@mit.edu
Tue, 13 Oct 1998 11:38:20 -0400


Date: Mon, 12 Oct 1998 11:11:44 +1000
From: Richard Gooch <rgooch@atnf.csiro.au>

This might be one way of fixing it. It seems to me, though, that the
bug is really in tty_open(), so perhaps that should be fixed.
Ted: what is your view on this?

The bug isn't in tty_open(), but in tty_init(); the tty driver shouldn't
be registering the dev_ptmx driver if the code to implement it isn't
there.

Linus, could you please apply this patch to 2.1.125?

- Ted

--- drivers/char/tty_io.c.0 Mon Oct 12 13:12:43 1998
+++ drivers/char/tty_io.c Mon Oct 12 13:14:13 1998
@@ -2091,6 +2091,7 @@
if (tty_register_driver(&dev_syscons_driver))
panic("Couldn't register /dev/console driver\n");

+#ifdef CONFIG_UNIX98_PTYS
dev_ptmx_driver = dev_tty_driver;
dev_ptmx_driver.driver_name = "/dev/ptmx";
dev_ptmx_driver.name = dev_ptmx_driver.driver_name + 5;
@@ -2101,7 +2102,8 @@

if (tty_register_driver(&dev_ptmx_driver))
panic("Couldn't register /dev/ptmx driver\n");
-
+#endif
+
#ifdef CONFIG_VT
dev_console_driver = dev_tty_driver;
dev_console_driver.driver_name = "/dev/tty0";

-
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/