loop: fix loop_add_fd when called multiple times

This commit is contained in:
emersion 2019-01-17 12:39:33 +01:00
parent 0c7932a3af
commit 28c0abbc57
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

2
loop.c
View File

@ -124,7 +124,7 @@ void loop_add_fd(struct loop *loop, int fd, short mask,
} }
event->callback = callback; event->callback = callback;
event->data = data; event->data = data;
wl_list_insert(&loop->fd_events, &event->link); wl_list_insert(loop->fd_events.prev, &event->link);
struct pollfd pfd = {fd, mask, 0}; struct pollfd pfd = {fd, mask, 0};