diff options
author | Nathan Hjelm <hjelmn@google.com> | 2019-08-14 14:00:41 -0700 |
---|---|---|
committer | Nathan Hjelm <hjelmn@google.com> | 2019-08-14 14:00:41 -0700 |
commit | dd7df2b75118c920cb21b4442983168e8b2f14ac (patch) | |
tree | f5f156131b199becd8a24c34669f18e2d5d79eec /libusb/os/windows_winusb.c | |
parent | afadbc7a89f49b70a09d0d809853777ce3a135bf (diff) | |
download | libusb-dd7df2b75118c920cb21b4442983168e8b2f14ac.tar.gz |
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>
Diffstat (limited to 'libusb/os/windows_winusb.c')
0 files changed, 0 insertions, 0 deletions