diff options
-rw-r--r-- | drivers/tty/tty_io.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 496657508772..3d71642b18ad 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -504,7 +504,7 @@ void proc_clear_tty(struct task_struct *p) | |||
504 | 504 | ||
505 | /* Called under the sighand lock */ | 505 | /* Called under the sighand lock */ |
506 | 506 | ||
507 | static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) | 507 | static void __proc_set_tty(struct tty_struct *tty) |
508 | { | 508 | { |
509 | if (tty) { | 509 | if (tty) { |
510 | unsigned long flags; | 510 | unsigned long flags; |
@@ -512,24 +512,24 @@ static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) | |||
512 | spin_lock_irqsave(&tty->ctrl_lock, flags); | 512 | spin_lock_irqsave(&tty->ctrl_lock, flags); |
513 | put_pid(tty->session); | 513 | put_pid(tty->session); |
514 | put_pid(tty->pgrp); | 514 | put_pid(tty->pgrp); |
515 | tty->pgrp = get_pid(task_pgrp(tsk)); | 515 | tty->pgrp = get_pid(task_pgrp(current)); |
516 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | 516 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); |
517 | tty->session = get_pid(task_session(tsk)); | 517 | tty->session = get_pid(task_session(current)); |
518 | if (tsk->signal->tty) { | 518 | if (current->signal->tty) { |
519 | printk(KERN_DEBUG "tty not NULL!!\n"); | 519 | printk(KERN_DEBUG "tty not NULL!!\n"); |
520 | tty_kref_put(tsk->signal->tty); | 520 | tty_kref_put(current->signal->tty); |
521 | } | 521 | } |
522 | } | 522 | } |
523 | put_pid(tsk->signal->tty_old_pgrp); | 523 | put_pid(current->signal->tty_old_pgrp); |
524 | tsk->signal->tty = tty_kref_get(tty); | 524 | current->signal->tty = tty_kref_get(tty); |
525 | tsk->signal->tty_old_pgrp = NULL; | 525 | current->signal->tty_old_pgrp = NULL; |
526 | } | 526 | } |
527 | 527 | ||
528 | static void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) | 528 | static void proc_set_tty(struct tty_struct *tty) |
529 | { | 529 | { |
530 | spin_lock_irq(&tsk->sighand->siglock); | 530 | spin_lock_irq(¤t->sighand->siglock); |
531 | __proc_set_tty(tsk, tty); | 531 | __proc_set_tty(tty); |
532 | spin_unlock_irq(&tsk->sighand->siglock); | 532 | spin_unlock_irq(¤t->sighand->siglock); |
533 | } | 533 | } |
534 | 534 | ||
535 | struct tty_struct *get_current_tty(void) | 535 | struct tty_struct *get_current_tty(void) |
@@ -2156,7 +2156,7 @@ retry_open: | |||
2156 | current->signal->leader && | 2156 | current->signal->leader && |
2157 | !current->signal->tty && | 2157 | !current->signal->tty && |
2158 | tty->session == NULL) | 2158 | tty->session == NULL) |
2159 | __proc_set_tty(current, tty); | 2159 | __proc_set_tty(tty); |
2160 | spin_unlock_irq(¤t->sighand->siglock); | 2160 | spin_unlock_irq(¤t->sighand->siglock); |
2161 | tty_unlock(tty); | 2161 | tty_unlock(tty); |
2162 | mutex_unlock(&tty_mutex); | 2162 | mutex_unlock(&tty_mutex); |
@@ -2482,7 +2482,7 @@ static int tiocsctty(struct tty_struct *tty, int arg) | |||
2482 | goto unlock; | 2482 | goto unlock; |
2483 | } | 2483 | } |
2484 | } | 2484 | } |
2485 | proc_set_tty(current, tty); | 2485 | proc_set_tty(tty); |
2486 | unlock: | 2486 | unlock: |
2487 | mutex_unlock(&tty_mutex); | 2487 | mutex_unlock(&tty_mutex); |
2488 | return ret; | 2488 | return ret; |