uloop: fix deleting pending fd events on uloop_fd_del
authorFelix Fietkau <nbd@openwrt.org>
Wed, 31 Jul 2013 22:01:00 +0000 (00:01 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 31 Jul 2013 22:01:40 +0000 (00:01 +0200)
commit04f194aa8a04926fe7f2e42bbf9ba6c62d49339e
treea8f00f6f8ec6da3c946d087343ad0c7f2832b7b3
parentef9b6b92df223e783a365f34998bc0f299b977f2
uloop: fix deleting pending fd events on uloop_fd_del

When a fd gets deleted internally due to errors, fd->registered gets set
to false before events are moved to the staging array.
This leads to pending events not getting cleared properly when the fd
user finally calls uloop_fd_del.
Fix this by moving the check down and always checking for pending
events.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uloop.c