patch-2.1.15 linux/drivers/char/tty_ioctl.c

Next file: linux/drivers/char/vga.c
Previous file: linux/drivers/char/tty_io.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.14/linux/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c
@@ -47,8 +47,7 @@
 #ifdef TTY_DEBUG_WAIT_UNTIL_SENT
 	printk("%s wait until sent...\n", tty_name(tty));
 #endif
-	if (!tty->driver.chars_in_buffer ||
-	    !tty->driver.chars_in_buffer(tty))
+	if (!tty->driver.chars_in_buffer)
 		return;
 	add_wait_queue(&tty->write_wait, &wait);
 	current->counter = 0;	/* make us low-priority */
@@ -462,10 +461,16 @@
 				return retval;
 			switch (arg) {
 			case TCOOFF:
-				stop_tty(tty);
+				if (!tty->flow_stopped) {
+					tty->flow_stopped = 1;
+					stop_tty(tty);
+				}
 				break;
 			case TCOON:
-				start_tty(tty);
+				if (tty->flow_stopped) {
+					tty->flow_stopped = 0;
+					start_tty(tty);
+				}
 				break;
 			case TCIOFF:
 				if (STOP_CHAR(tty) != __DISABLED_CHAR)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov