diff options
Diffstat (limited to 'drivers/char/n_tty.c')
| -rw-r--r-- | drivers/char/n_tty.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index edba5a35bf21..09103b3d8f05 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c | |||
| @@ -770,10 +770,8 @@ send_signal: | |||
| 770 | } | 770 | } |
| 771 | if (c == '\n') { | 771 | if (c == '\n') { |
| 772 | if (L_ECHO(tty) || L_ECHONL(tty)) { | 772 | if (L_ECHO(tty) || L_ECHONL(tty)) { |
| 773 | if (tty->read_cnt >= N_TTY_BUF_SIZE-1) { | 773 | if (tty->read_cnt >= N_TTY_BUF_SIZE-1) |
| 774 | put_char('\a', tty); | 774 | put_char('\a', tty); |
| 775 | return; | ||
| 776 | } | ||
| 777 | opost('\n', tty); | 775 | opost('\n', tty); |
| 778 | } | 776 | } |
| 779 | goto handle_newline; | 777 | goto handle_newline; |
| @@ -790,10 +788,8 @@ send_signal: | |||
| 790 | * XXX are EOL_CHAR and EOL2_CHAR echoed?!? | 788 | * XXX are EOL_CHAR and EOL2_CHAR echoed?!? |
| 791 | */ | 789 | */ |
| 792 | if (L_ECHO(tty)) { | 790 | if (L_ECHO(tty)) { |
| 793 | if (tty->read_cnt >= N_TTY_BUF_SIZE-1) { | 791 | if (tty->read_cnt >= N_TTY_BUF_SIZE-1) |
| 794 | put_char('\a', tty); | 792 | put_char('\a', tty); |
| 795 | return; | ||
| 796 | } | ||
| 797 | /* Record the column of first canon char. */ | 793 | /* Record the column of first canon char. */ |
| 798 | if (tty->canon_head == tty->read_head) | 794 | if (tty->canon_head == tty->read_head) |
| 799 | tty->canon_column = tty->column; | 795 | tty->canon_column = tty->column; |
| @@ -862,12 +858,9 @@ static int n_tty_receive_room(struct tty_struct *tty) | |||
| 862 | * that erase characters will be handled. Other excess | 858 | * that erase characters will be handled. Other excess |
| 863 | * characters will be beeped. | 859 | * characters will be beeped. |
| 864 | */ | 860 | */ |
| 865 | if (tty->icanon && !tty->canon_data) | 861 | if (left <= 0) |
| 866 | return N_TTY_BUF_SIZE; | 862 | left = tty->icanon && !tty->canon_data; |
| 867 | 863 | return left; | |
| 868 | if (left > 0) | ||
| 869 | return left; | ||
| 870 | return 0; | ||
| 871 | } | 864 | } |
| 872 | 865 | ||
| 873 | /** | 866 | /** |
| @@ -1473,13 +1466,17 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file, | |||
| 1473 | if (tty->driver->flush_chars) | 1466 | if (tty->driver->flush_chars) |
| 1474 | tty->driver->flush_chars(tty); | 1467 | tty->driver->flush_chars(tty); |
| 1475 | } else { | 1468 | } else { |
| 1476 | c = tty->driver->write(tty, b, nr); | 1469 | while (nr > 0) { |
| 1477 | if (c < 0) { | 1470 | c = tty->driver->write(tty, b, nr); |
| 1478 | retval = c; | 1471 | if (c < 0) { |
| 1479 | goto break_out; | 1472 | retval = c; |
| 1473 | goto break_out; | ||
| 1474 | } | ||
| 1475 | if (!c) | ||
| 1476 | break; | ||
| 1477 | b += c; | ||
| 1478 | nr -= c; | ||
| 1480 | } | 1479 | } |
| 1481 | b += c; | ||
| 1482 | nr -= c; | ||
| 1483 | } | 1480 | } |
| 1484 | if (!nr) | 1481 | if (!nr) |
| 1485 | break; | 1482 | break; |
