event: rework gpiod_line_event_wait_bulk()
authorBartosz Golaszewski <bartekgola@gmail.com>
Wed, 11 Oct 2017 09:25:17 +0000 (11:25 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 11 Oct 2017 09:31:54 +0000 (11:31 +0200)
commitac2891d920f1988b94a85220a1f05262c31ee4d7
treee7c702851f71108141a5137bc8d4a3a72958bc66
parent7c7846b66ac1c0d548d2a713300f7c0ae7fd6bcb
event: rework gpiod_line_event_wait_bulk()

When monitoring more than one line, it's possible for two or more
events to be queued at the same time in the kernel, so the internal
call to ppoll() will return a value greater than 1. If we always only
read one event at most, we end up calling ppoll() needlessly, as we
already know more events are pending.

Allow gpiod_line_event_wait_bulk() to pass a list of all lines on
which events occurred via a line bulk object.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
include/gpiod.h
src/lib/core.c
tests/tests-event.c