Skip to content

Commit

Permalink
input-raw: return read() errno on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
merge committed Mar 11, 2017
1 parent a74c78b commit 75b5f40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/input-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,10 @@ static int ts_input_read_mt(struct tslib_module_info *inf,
rd = read(ts->fd,
i->ev,
sizeof(struct input_event) * NUM_EVENTS_READ);
if (rd < (int) sizeof(struct input_event)) {
if (rd == -1) {
total = errno * -1;
break;
} else if (rd < (int) sizeof(struct input_event)) {
total = -1;
break;
}
Expand Down

0 comments on commit 75b5f40

Please sign in to comment.