patch-2.1.127 linux/drivers/char/tty_ioctl.c
Next file: linux/drivers/char/tuner.c
Previous file: linux/drivers/char/tty_io.c
Back to the patch index
Back to the overall index
- Lines: 41
- Date:
Sat Oct 31 10:17:22 1998
- Orig file:
v2.1.126/linux/drivers/char/tty_ioctl.c
- Orig date:
Tue Mar 17 22:18:14 1998
diff -u --recursive --new-file v2.1.126/linux/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c
@@ -40,7 +40,7 @@
#define TERMIOS_WAIT 2
#define TERMIOS_TERMIO 4
-void tty_wait_until_sent(struct tty_struct * tty, int timeout)
+void tty_wait_until_sent(struct tty_struct * tty, long timeout)
{
struct wait_queue wait = { current, NULL };
@@ -53,10 +53,8 @@
return;
add_wait_queue(&tty->write_wait, &wait);
current->counter = 0; /* make us low-priority */
- if (timeout)
- current->timeout = timeout + jiffies;
- else
- current->timeout = (unsigned) -1;
+ if (!timeout)
+ timeout = MAX_SCHEDULE_TIMEOUT;
do {
#ifdef TTY_DEBUG_WAIT_UNTIL_SENT
printk("waiting %s...(%d)\n", tty_name(tty, buf),
@@ -67,15 +65,10 @@
goto stop_waiting;
if (!tty->driver.chars_in_buffer(tty))
break;
- schedule();
- } while (current->timeout);
- if (tty->driver.wait_until_sent) {
- if (current->timeout == -1)
- timeout = 0;
- else
- timeout = current->timeout - jiffies;
+ timeout = schedule_timeout(timeout);
+ } while (timeout);
+ if (tty->driver.wait_until_sent)
tty->driver.wait_until_sent(tty, timeout);
- }
stop_waiting:
current->state = TASK_RUNNING;
remove_wait_queue(&tty->write_wait, &wait);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov