Currently we keep a file descriptor for each source and construct a pollfd array
from these during each loop iteration in sr_session_run(). This patch modifies
the code to keep a global pollfd array which is only modified when a source is
added or removed. On one hand this gets rid of the constant
A raw file descriptor to poll on is not always available, this patch adds
support for adding a source for a GIOChannel or GPollFD.
Signed-off-by: Lars-Peter Clausen
---
libsigrok/session.c | 164 +-
libsigrok/sigrok-proto.h |6 ++
2 files cha
The session and demo device code contain a hack to make the demo device work on
Windows. This was neccessary since polling on windows requires special handling
and we can not just pass in the raw fd to poll.
With the previous patches which added support for non-fd based event sources
this hack is
Use realloc to resize the source array when adding or removing a source. This
makes the code a bit smaller. In the remove function we now check whether the fd
is valid before doing anything else and if it is not simply do nothing. If it is
valid use memove to move the elements following the source
4 matches
Mail list logo