|
@@ -2260,10 +2260,11 @@ out:
|
|
|
static int tty_fasync(int fd, struct file *filp, int on)
|
|
|
{
|
|
|
struct tty_struct *tty = file_tty(filp);
|
|
|
- int retval;
|
|
|
+ int retval = -ENOTTY;
|
|
|
|
|
|
tty_lock(tty);
|
|
|
- retval = __tty_fasync(fd, filp, on);
|
|
|
+ if (!tty_hung_up_p(filp))
|
|
|
+ retval = __tty_fasync(fd, filp, on);
|
|
|
tty_unlock(tty);
|
|
|
|
|
|
return retval;
|