aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/pty.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/pty.c')
-rw-r--r--drivers/tty/pty.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 79ff3a5e925d..755600f6120f 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -47,7 +47,6 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
47 /* Review - krefs on tty_link ?? */ 47 /* Review - krefs on tty_link ?? */
48 if (!tty->link) 48 if (!tty->link)
49 return; 49 return;
50 tty->link->packet = 0;
51 set_bit(TTY_OTHER_CLOSED, &tty->link->flags); 50 set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
52 wake_up_interruptible(&tty->link->read_wait); 51 wake_up_interruptible(&tty->link->read_wait);
53 wake_up_interruptible(&tty->link->write_wait); 52 wake_up_interruptible(&tty->link->write_wait);
@@ -55,9 +54,9 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
55 set_bit(TTY_OTHER_CLOSED, &tty->flags); 54 set_bit(TTY_OTHER_CLOSED, &tty->flags);
56#ifdef CONFIG_UNIX98_PTYS 55#ifdef CONFIG_UNIX98_PTYS
57 if (tty->driver == ptm_driver) { 56 if (tty->driver == ptm_driver) {
58 mutex_lock(&devpts_mutex); 57 mutex_lock(&devpts_mutex);
59 devpts_pty_kill(tty->link->driver_data); 58 devpts_pty_kill(tty->link->driver_data);
60 mutex_unlock(&devpts_mutex); 59 mutex_unlock(&devpts_mutex);
61 } 60 }
62#endif 61#endif
63 tty_unlock(tty); 62 tty_unlock(tty);
@@ -120,10 +119,10 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
120 119
121 if (c > 0) { 120 if (c > 0) {
122 /* Stuff the data into the input queue of the other end */ 121 /* Stuff the data into the input queue of the other end */
123 c = tty_insert_flip_string(to, buf, c); 122 c = tty_insert_flip_string(to->port, buf, c);
124 /* And shovel */ 123 /* And shovel */
125 if (c) { 124 if (c) {
126 tty_flip_buffer_push(to); 125 tty_flip_buffer_push(to->port);
127 tty_wakeup(tty); 126 tty_wakeup(tty);
128 } 127 }
129 } 128 }
@@ -663,7 +662,7 @@ static const struct tty_operations pty_unix98_ops = {
663 * Allocate a unix98 pty master device from the ptmx driver. 662 * Allocate a unix98 pty master device from the ptmx driver.
664 * 663 *
665 * Locking: tty_mutex protects the init_dev work. tty->count should 664 * Locking: tty_mutex protects the init_dev work. tty->count should
666 * protect the rest. 665 * protect the rest.
667 * allocated_ptys_lock handles the list of free pty numbers 666 * allocated_ptys_lock handles the list of free pty numbers
668 */ 667 */
669 668
@@ -797,7 +796,7 @@ static void __init unix98_pty_init(void)
797 cdev_init(&ptmx_cdev, &ptmx_fops); 796 cdev_init(&ptmx_cdev, &ptmx_fops);
798 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || 797 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
799 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) 798 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
800 panic("Couldn't register /dev/ptmx driver\n"); 799 panic("Couldn't register /dev/ptmx driver");
801 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); 800 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
802} 801}
803 802