diff options
author | Felix Fietkau <nbd@nbd.name> | 2023-11-27 16:59:06 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-11-27 20:30:01 +0300 |
commit | b3fa3d92e3ebae9b224a0111427d6bdd8b869399 (patch) | |
tree | 89ff67e463381f238925c1c1e03d0393aa53fc13 | |
parent | 8a5a4319a85cdfe54998c8f15bb29cd81b2b2c01 (diff) |
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>
-rw-r--r-- | uloop.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -264,6 +264,7 @@ out: int uloop_fd_delete(struct uloop_fd *fd) { + int ret; int 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); fd->registered = false; - fd->flags = 0; 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) |