patch-2.0.31 linux/drivers/char/n_tty.c
Next file: linux/drivers/char/pcwd.c
Previous file: linux/drivers/char/misc.c
Back to the patch index
Back to the overall index
-  Lines: 14
-  Date:
Thu Aug  7 09:34:37 1997
-  Orig file: 
v2.0.30/linux/drivers/char/n_tty.c
-  Orig date: 
Mon Sep  2 05:18:26 1996
diff -u --recursive --new-file v2.0.30/linux/drivers/char/n_tty.c linux/drivers/char/n_tty.c
@@ -89,6 +89,13 @@
  */
 int n_tty_chars_in_buffer(struct tty_struct *tty)
 {
+	if (tty->icanon) {
+		if (!tty->canon_data) return 0;
+
+		return (tty->canon_head > tty->read_tail) ?
+			tty->canon_head - tty->read_tail :
+			tty->canon_head + (N_TTY_BUF_SIZE - tty->read_tail);
+	}
 	return tty->read_cnt;
 }
 
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov