patch-2.3.1 linux/drivers/char/pty.c

Next file: linux/drivers/char/qpmouse.c
Previous file: linux/drivers/char/pc_keyb.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.0/linux/drivers/char/pty.c linux/drivers/char/pty.c
@@ -30,7 +30,7 @@
 
 struct pty_struct {
 	int	magic;
-	struct wait_queue * open_wait;
+	wait_queue_head_t open_wait;
 };
 
 #define PTY_MAGIC 0x5001
@@ -336,13 +336,13 @@
 
 __initfunc(int pty_init(void))
 {
-#ifdef CONFIG_UNIX98_PTYS
 	int i;
-#endif
 
 	/* Traditional BSD devices */
 
 	memset(&pty_state, 0, sizeof(pty_state));
+	for (i = 0; i < NR_PTYS; i++)
+		init_waitqueue_head(&pty_state[i].open_wait);
 	memset(&pty_driver, 0, sizeof(struct tty_driver));
 	pty_driver.magic = TTY_DRIVER_MAGIC;
 	pty_driver.driver_name = "pty_master";
@@ -405,6 +405,8 @@
 #ifdef CONFIG_UNIX98_PTYS
 	printk("pty: %d Unix98 ptys configured\n", UNIX98_NR_MAJORS*NR_PTYS);
 	for ( i = 0 ; i < UNIX98_NR_MAJORS ; i++ ) {
+		int j;
+
 		ptm_driver[i] = pty_driver;
 		ptm_driver[i].name = "ptm";
 		ptm_driver[i].proc_entry = 0;
@@ -417,6 +419,9 @@
 		ptm_driver[i].termios = ptm_termios[i];
 		ptm_driver[i].termios_locked = ptm_termios_locked[i];
 		ptm_driver[i].driver_state = ptm_state[i];
+
+		for (j = 0; j < NR_PTYS; j++)
+			init_waitqueue_head(&ptm_state[i][j].open_wait);
 		
 		pts_driver[i] = pty_slave_driver;
 		pts_driver[i].name = "pts";

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)