n_tty: Simplify input_available_p()
Greg, Please note this patch requires n_tty: Fix poll() when TIME_CHAR and MIN_CHAR == 0 Regards, Peter Hurley Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5669b70502
commit
25e8d0ed75
1 changed files with 4 additions and 7 deletions
|
@ -1900,13 +1900,10 @@ static inline int input_available_p(struct tty_struct *tty, int poll)
|
||||||
struct n_tty_data *ldata = tty->disc_data;
|
struct n_tty_data *ldata = tty->disc_data;
|
||||||
int amt = poll && !TIME_CHAR(tty) && MIN_CHAR(tty) ? MIN_CHAR(tty) : 1;
|
int amt = poll && !TIME_CHAR(tty) && MIN_CHAR(tty) ? MIN_CHAR(tty) : 1;
|
||||||
|
|
||||||
if (ldata->icanon && !L_EXTPROC(tty)) {
|
if (ldata->icanon && !L_EXTPROC(tty))
|
||||||
if (ldata->canon_head != ldata->read_tail)
|
return ldata->canon_head != ldata->read_tail;
|
||||||
return 1;
|
else
|
||||||
} else if (read_cnt(ldata) >= amt)
|
return read_cnt(ldata) >= amt;
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue