Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100400
b: refs/heads/master
c: 5d1e323
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Corbet committed Jul 2, 2008
1 parent 7f8bf2f commit d7d51ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 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: 9d319522576ce0b2fd023a965445f9c3739ee6f1
refs/heads/master: 5d1e3230f4b4a93c6561b0fb5a99bb1eb02227ed
14 changes: 9 additions & 5 deletions trunk/drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2909,15 +2909,16 @@ static int tty_fasync(int fd, struct file *filp, int on)
{
struct tty_struct *tty;
unsigned long flags;
int retval;
int retval = 0;

lock_kernel();
tty = (struct tty_struct *)filp->private_data;
if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_fasync"))
return 0;
goto out;

retval = fasync_helper(fd, filp, on, &tty->fasync);
if (retval <= 0)
return retval;
goto out;

if (on) {
enum pid_type type;
Expand All @@ -2935,12 +2936,15 @@ static int tty_fasync(int fd, struct file *filp, int on)
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
retval = __f_setown(filp, pid, type, 0);
if (retval)
return retval;
goto out;
} else {
if (!tty->fasync && !waitqueue_active(&tty->read_wait))
tty->minimum_to_wake = N_TTY_BUF_SIZE;
}
return 0;
retval = 0;
out:
unlock_kernel();
return retval;
}

/**
Expand Down

0 comments on commit d7d51ce

Please sign in to comment.