Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113451
b: refs/heads/master
c: 2cb5998
h: refs/heads/master
i:
  113449: 1ec89e9
  113447: 90ef345
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Oct 13, 2008
1 parent 2e3ba56 commit 212ba91
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 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: 216ba023a96c04e8d3aabf83d5931c35b6e2dbbb
refs/heads/master: 2cb5998b5f0ccc886fdda3509059eef297b49577
19 changes: 19 additions & 0 deletions trunk/drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,25 @@ void tty_vhangup(struct tty_struct *tty)

EXPORT_SYMBOL(tty_vhangup);

/**
* tty_vhangup_self - process vhangup for own ctty
*
* Perform a vhangup on the current controlling tty
*/

void tty_vhangup_self(void)
{
struct tty_struct *tty;

mutex_lock(&tty_mutex);
tty = get_current_tty();
if (tty) {
tty_vhangup(tty);
tty_kref_put(tty);
}
mutex_unlock(&tty_mutex);
}

/**
* tty_hung_up_p - was tty hung up
* @filp: file pointer of tty
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,8 +1141,7 @@ EXPORT_SYMBOL(sys_close);
asmlinkage long sys_vhangup(void)
{
if (capable(CAP_SYS_TTY_CONFIG)) {
/* XXX: this needs locking */
tty_vhangup(current->signal->tty);
tty_vhangup_self();
return 0;
}
return -EPERM;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ extern int is_ignored(int sig);
extern int tty_signal(int sig, struct tty_struct *tty);
extern void tty_hangup(struct tty_struct *tty);
extern void tty_vhangup(struct tty_struct *tty);
extern void tty_vhangup_self(void);
extern void tty_unhangup(struct file *filp);
extern int tty_hung_up_p(struct file *filp);
extern void do_SAK(struct tty_struct *tty);
Expand Down

0 comments on commit 212ba91

Please sign in to comment.