Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4260
b: refs/heads/master
c: d6afe27
h: refs/heads/master
v: v3
  • Loading branch information
Roman Zippel authored and Linus Torvalds committed Jul 8, 2005
1 parent 2670bcf commit e091aa4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8759145114f72857bcaeed338db21620a6619b26
refs/heads/master: d6afe27bfff30fbec2cca6ad5626c22f4094d770
33 changes: 15 additions & 18 deletions trunk/drivers/char/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
}
if (c == '\n') {
if (L_ECHO(tty) || L_ECHONL(tty)) {
if (tty->read_cnt >= N_TTY_BUF_SIZE-1) {
if (tty->read_cnt >= N_TTY_BUF_SIZE-1)
put_char('\a', tty);
return;
}
opost('\n', tty);
}
goto handle_newline;
Expand All @@ -790,10 +788,8 @@ static inline void n_tty_receive_char(struct tty_struct *tty, unsigned char c)
* XXX are EOL_CHAR and EOL2_CHAR echoed?!?
*/
if (L_ECHO(tty)) {
if (tty->read_cnt >= N_TTY_BUF_SIZE-1) {
if (tty->read_cnt >= N_TTY_BUF_SIZE-1)
put_char('\a', tty);
return;
}
/* Record the column of first canon char. */
if (tty->canon_head == tty->read_head)
tty->canon_column = tty->column;
Expand Down Expand Up @@ -862,12 +858,9 @@ static int n_tty_receive_room(struct tty_struct *tty)
* that erase characters will be handled. Other excess
* characters will be beeped.
*/
if (tty->icanon && !tty->canon_data)
return N_TTY_BUF_SIZE;

if (left > 0)
return left;
return 0;
if (left <= 0)
left = tty->icanon && !tty->canon_data;
return left;
}

/**
Expand Down Expand Up @@ -1473,13 +1466,17 @@ static ssize_t write_chan(struct tty_struct * tty, struct file * file,
if (tty->driver->flush_chars)
tty->driver->flush_chars(tty);
} else {
c = tty->driver->write(tty, b, nr);
if (c < 0) {
retval = c;
goto break_out;
while (nr > 0) {
c = tty->driver->write(tty, b, nr);
if (c < 0) {
retval = c;
goto break_out;
}
if (!c)
break;
b += c;
nr -= c;
}
b += c;
nr -= c;
}
if (!nr)
break;
Expand Down

0 comments on commit e091aa4

Please sign in to comment.