mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
n_tty: Fix poll() when TIME_CHAR and MIN_CHAR == 0
Commit eafbe67f84,
n_tty: Refactor input_available_p() by call site
broke poll() when TIME_CHAR(tty) and MIN_CHAR(tty) are both 0.
When TIME_CHAR and MIN_CHAR are both 0, input is available if the
read_cnt is 1 (not 0).
Reported-by: Eric Dumazet <[email protected]>
Tested-by: Eric Dumazet <[email protected]>
Reported-by: Stephane Eranian <[email protected]>
Tested-by: David Ahern <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Peter Hurley <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
a64c1a1c75
commit
a5934804a8
1 changed files with 1 additions and 1 deletions
|
|
@ -1896,7 +1896,7 @@ err:
|
|||
static inline int input_available_p(struct tty_struct *tty, int poll)
|
||||
{
|
||||
struct n_tty_data *ldata = tty->disc_data;
|
||||
int amt = poll && !TIME_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->canon_head != ldata->read_tail)
|
||||
|
|
|
|||
Loading…
Reference in a new issue