Skip to content

Instantly share code, notes, and snippets.

@kanru
Created October 5, 2008 11:54
Show Gist options
  • Save kanru/14874 to your computer and use it in GitHub Desktop.
Save kanru/14874 to your computer and use it in GitHub Desktop.
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 7501310..d529bb9 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3021,6 +3021,11 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *re
rpgrp = get_pid(real_tty->pgrp);
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+ /* NOTE: This isn't really fix the problem, just lower the probability
+ * it occured */
+ tty->winsize = tmp_ws;
+ real_tty->winsize = tmp_ws;
+
if (pgrp)
kill_pgrp(pgrp, SIGWINCH, 1);
if (rpgrp != pgrp && rpgrp)
@@ -3028,9 +3033,6 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *rea
put_pid(pgrp);
put_pid(rpgrp);
-
- tty->winsize = tmp_ws;
- real_tty->winsize = tmp_ws;
done:
mutex_unlock(&tty->termios_mutex);
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment