Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280660
b: refs/heads/master
c: 1411dc4
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Nov 15, 2011
1 parent 381ad00 commit 226aa8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e30f867d402d6dcc2d03d8dd5da3863f7c83572a
refs/heads/master: 1411dc4aa21d364f40ed363c8e715939c15f57c2
15 changes: 7 additions & 8 deletions trunk/drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,19 +790,24 @@ static void session_clear_tty(struct pid *session)
void disassociate_ctty(int on_exit)
{
struct tty_struct *tty;
struct pid *tty_pgrp = NULL;

if (!current->signal->leader)
return;

tty = get_current_tty();
if (tty) {
tty_pgrp = get_pid(tty->pgrp);
struct pid *tty_pgrp = get_pid(tty->pgrp);
if (on_exit) {
if (tty->driver->type != TTY_DRIVER_TYPE_PTY)
tty_vhangup(tty);
}
tty_kref_put(tty);
if (tty_pgrp) {
kill_pgrp(tty_pgrp, SIGHUP, on_exit);
if (!on_exit)
kill_pgrp(tty_pgrp, SIGCONT, on_exit);
put_pid(tty_pgrp);
}
} else if (on_exit) {
struct pid *old_pgrp;
spin_lock_irq(&current->sighand->siglock);
Expand All @@ -816,12 +821,6 @@ void disassociate_ctty(int on_exit)
}
return;
}
if (tty_pgrp) {
kill_pgrp(tty_pgrp, SIGHUP, on_exit);
if (!on_exit)
kill_pgrp(tty_pgrp, SIGCONT, on_exit);
put_pid(tty_pgrp);
}

spin_lock_irq(&current->sighand->siglock);
put_pid(current->signal->tty_old_pgrp);
Expand Down

0 comments on commit 226aa8b

Please sign in to comment.