mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-05 05:18:25 +02:00
xf86: use nt_list_for_each_entry_safe to walk InputHandlers in xf86Wakeup
This is necessary when the input handler deletes itself from the
list. Bug found by Maarten Lankhorst, this patch uses the list macros
instead of open-coding the fix.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit da92690107)
This commit is contained in:
parent
eec5eb2f09
commit
4bd8e9ecc3
1 changed files with 2 additions and 2 deletions
|
|
@ -272,9 +272,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
|
|||
}
|
||||
|
||||
if (err >= 0) { /* we don't want the handlers called if select() */
|
||||
IHPtr ih; /* returned with an error condition, do we? */
|
||||
IHPtr ih, ih_tmp; /* returned with an error condition, do we? */
|
||||
|
||||
for (ih = InputHandlers; ih; ih = ih->next) {
|
||||
nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) {
|
||||
if (ih->enabled && ih->fd >= 0 && ih->ihproc &&
|
||||
(FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) {
|
||||
ih->ihproc(ih->fd, ih->data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue