diff options
Diffstat (limited to 'src/iobuf.c')
| -rw-r--r-- | src/iobuf.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/iobuf.c b/src/iobuf.c index 6516a2c..050f2ed 100644 --- a/src/iobuf.c +++ b/src/iobuf.c | |||
| @@ -32,13 +32,9 @@ | |||
| 32 | 32 | ||
| 33 | int mtdev_idle(struct mtdev *dev, int fd, int ms) | 33 | int mtdev_idle(struct mtdev *dev, int fd, int ms) |
| 34 | { | 34 | { |
| 35 | struct mtdev_state *state = dev->state; | 35 | struct mtdev_iobuf *buf = &dev->state->iobuf; |
| 36 | struct mtdev_iobuf *buf = &state->iobuf; | ||
| 37 | struct pollfd fds = { fd, POLLIN, 0 }; | 36 | struct pollfd fds = { fd, POLLIN, 0 }; |
| 38 | return evbuf_empty(&state->outbuf) && | 37 | return buf->head == buf->tail && poll(&fds, 1, ms) <= 0; |
| 39 | evbuf_empty(&state->inbuf) && | ||
| 40 | buf->head == buf->tail && | ||
| 41 | poll(&fds, 1, ms) <= 0; | ||
| 42 | } | 38 | } |
| 43 | 39 | ||
| 44 | int mtdev_fetch(struct mtdev *dev, int fd, struct input_event *ev) | 40 | int mtdev_fetch(struct mtdev *dev, int fd, struct input_event *ev) |
