aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 3d71642b18ad..6bf5f44d215e 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2324,18 +2324,14 @@ static int tiocgwinsz(struct tty_struct *tty, struct winsize __user *arg)
2324int tty_do_resize(struct tty_struct *tty, struct winsize *ws) 2324int tty_do_resize(struct tty_struct *tty, struct winsize *ws)
2325{ 2325{
2326 struct pid *pgrp; 2326 struct pid *pgrp;
2327 unsigned long flags;
2328 2327
2329 /* Lock the tty */ 2328 /* Lock the tty */
2330 mutex_lock(&tty->winsize_mutex); 2329 mutex_lock(&tty->winsize_mutex);
2331 if (!memcmp(ws, &tty->winsize, sizeof(*ws))) 2330 if (!memcmp(ws, &tty->winsize, sizeof(*ws)))
2332 goto done; 2331 goto done;
2333 /* Get the PID values and reference them so we can
2334 avoid holding the tty ctrl lock while sending signals */
2335 spin_lock_irqsave(&tty->ctrl_lock, flags);
2336 pgrp = get_pid(tty->pgrp);
2337 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
2338 2332
2333 /* Signal the foreground process group */
2334 pgrp = tty_get_pgrp(tty);
2339 if (pgrp) 2335 if (pgrp)
2340 kill_pgrp(pgrp, SIGWINCH, 1); 2336 kill_pgrp(pgrp, SIGWINCH, 1);
2341 put_pid(pgrp); 2337 put_pid(pgrp);