patch-2.1.116 linux/drivers/char/tty_io.c

Next file: linux/drivers/char/videodev.c
Previous file: linux/drivers/char/radio-zoltrix.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.115/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
@@ -1238,7 +1238,7 @@
 #ifdef CONFIG_UNIX98_PTYS
 	if (device == PTMX_DEV) {
 		/* find a free pty. */
-		int major, minor, line;
+		int major, minor;
 		struct tty_driver *driver;
 
 		/* find a device that is not in use. */
@@ -1255,9 +1255,8 @@
 		return -EIO; /* no free ptys */
 	ptmx_found:
 		set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
-		line = minor - driver->minor_start;
-		devpts_pty_new(line + major*NR_PTYS, MKDEV(driver->other->major,
-				   line+driver->other->minor_start));
+		minor -= driver->minor_start;
+		devpts_pty_new(driver->other->name_base + minor, MKDEV(driver->other->major, minor + driver->other->minor_start));
 		noctty = 1;
 		goto init_dev_done;
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov