commit | dd7df2b75118c920cb21b4442983168e8b2f14ac | [log] [tgz] |
---|---|---|
author | Nathan Hjelm <hjelmn@google.com> | Wed Aug 14 14:00:41 2019 -0700 |
committer | Nathan Hjelm <hjelmn@google.com> | Wed Aug 14 14:00:41 2019 -0700 |
tree | f5f156131b199becd8a24c34669f18e2d5d79eec | |
parent | afadbc7a89f49b70a09d0d809853777ce3a135bf [diff] |
core: protect against changes to the pollfd list during handle_events It is possible a file descriptor to be removed due to a close and the same file descriptor value to be added during the same event loop. This can cause the backend to get a stale revent and incorrectly remove the file descriptor. This commit addresses the issue by delaying the actual removal of the ipollfds entry until just before the backend handle_events is called. handle_events then goes through the list of closed fds and clears out the revents associated with the closed file descriptor. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD and Haiku userspace. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).
libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.
libusb homepage: http://libusb.info/
Developers will wish to consult the API documentation: http://api.libusb.info
Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info
(Please use the mailing list rather than mailing developers directly)