patch-2.0.24 linux/drivers/char/selection.c

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

diff -u --recursive --new-file v2.0.23/linux/drivers/char/selection.c linux/drivers/char/selection.c
@@ -289,9 +289,9 @@
 	if (!bp || !c)
 		return 0;
 	do_unblank_screen();
-	current->state = TASK_INTERRUPTIBLE;
 	add_wait_queue(&vt->paste_wait, &wait);
-	while (c) {
+	do {
+		current->state = TASK_INTERRUPTIBLE;
 		if (test_bit(TTY_THROTTLED, &tty->flags)) {
 			schedule();
 			continue;
@@ -300,7 +300,8 @@
 		tty->ldisc.receive_buf(tty, bp, 0, l);
 		c -= l;
 		bp += l;
-	}
+	} while (c);
+	remove_wait_queue(&vt->paste_wait, &wait);
 	current->state = TASK_RUNNING;
 	return 0;
 }

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