uloop: reset flags after __uloop_fd_delete call
Fixes fd delete with kqueue, which relies on the previous flags value Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
8a5a4319a8
commit
b3fa3d92e3
1 changed files with 5 additions and 2 deletions
7
uloop.c
7
uloop.c
|
@ -264,6 +264,7 @@ out:
|
||||||
|
|
||||||
int uloop_fd_delete(struct uloop_fd *fd)
|
int uloop_fd_delete(struct uloop_fd *fd)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < cur_nfds; i++) {
|
for (i = 0; i < cur_nfds; i++) {
|
||||||
|
@ -280,9 +281,11 @@ int uloop_fd_delete(struct uloop_fd *fd)
|
||||||
uloop_fd_set_cb(fd, 0);
|
uloop_fd_set_cb(fd, 0);
|
||||||
|
|
||||||
fd->registered = false;
|
fd->registered = false;
|
||||||
fd->flags = 0;
|
|
||||||
uloop_fd_stack_event(fd, -1);
|
uloop_fd_stack_event(fd, -1);
|
||||||
return __uloop_fd_delete(fd);
|
ret = __uloop_fd_delete(fd);
|
||||||
|
fd->flags = 0;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t tv_diff(struct timeval *t1, struct timeval *t2)
|
static int64_t tv_diff(struct timeval *t1, struct timeval *t2)
|
||||||
|
|
Loading…
Reference in a new issue