diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2010-06-18 01:39:40 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-06-18 01:39:40 +0200 |
commit | 309df849b8ad3772b912d498eacda9f38a6e4f1e (patch) | |
tree | 03c47e2a3399672d4528397c1ef980601f0488b9 /src | |
parent | d62c625535494361b8ba0a004a1d24ce485f0b59 (diff) | |
download | mtdev-git-309df849b8ad3772b912d498eacda9f38a6e4f1e.tar.gz |
Correct semantic error in mtdev_idle
The current semantics, that a non-empty conversion pipe means
the device is not idle, is not very useful. This patch changes
the semantics to simply checking if the fetch buffer is empty,
and if there are no events to fetch from the device.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src')
-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 @@ int mtdev_idle(struct mtdev *dev, int fd, int ms) { - struct mtdev_state *state = dev->state; - struct mtdev_iobuf *buf = &state->iobuf; + struct mtdev_iobuf *buf = &dev->state->iobuf; struct pollfd fds = { fd, POLLIN, 0 }; - return evbuf_empty(&state->outbuf) && - evbuf_empty(&state->inbuf) && - buf->head == buf->tail && - poll(&fds, 1, ms) <= 0; + return buf->head == buf->tail && poll(&fds, 1, ms) <= 0; } int mtdev_fetch(struct mtdev *dev, int fd, struct input_event *ev) |