From 326b8789f41dc77cdaf9e01ce811c1def68aa218 Mon Sep 17 00:00:00 2001 From: Thomas Pfaff Date: Fri, 2 Jan 2009 13:47:13 +0000 Subject: [PATCH] --- yaml --- r: 125065 b: refs/heads/master c: ff8cb0fd6f195389aefe55d5dac9927d09a9de54 h: refs/heads/master i: 125063: e0238c0f49473e14074180636ac138f03bdd2974 v: v3 --- [refs] | 2 +- trunk/drivers/char/n_tty.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 76731253176b..9f0e4ea55e09 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eff6937a46e096eb35c16a391617b7a5e098a30c +refs/heads/master: ff8cb0fd6f195389aefe55d5dac9927d09a9de54 diff --git a/trunk/drivers/char/n_tty.c b/trunk/drivers/char/n_tty.c index 3922a084205e..f6f0e4ec2b51 100644 --- a/trunk/drivers/char/n_tty.c +++ b/trunk/drivers/char/n_tty.c @@ -1352,10 +1352,8 @@ static void n_tty_write_wakeup(struct tty_struct *tty) /* Write out any echoed characters that are still pending */ process_echoes(tty); - if (tty->fasync) { - set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); + if (tty->fasync && test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) kill_fasync(&tty->fasync, SIGIO, POLL_OUT); - } } /** @@ -2014,6 +2012,8 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, break_out: __set_current_state(TASK_RUNNING); remove_wait_queue(&tty->write_wait, &wait); + if (b - buf != nr && tty->fasync) + set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); return (b - buf) ? b - buf : retval; }