Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+ if (!sock->registered)
+ return 0;
+
for (i = cur_fd + 1; i < cur_nfds; i++) {
if (events[i].data.ptr != sock)
continue;
for (i = cur_fd + 1; i < cur_nfds; i++) {
if (events[i].data.ptr != sock)
continue;
unsigned int fl;
int ret;
unsigned int fl;
int ret;
+ if (!(flags & (ULOOP_READ | ULOOP_WRITE)))
+ return uloop_fd_delete(sock);
+
if (!sock->registered && !(flags & ULOOP_BLOCKING)) {
fl = fcntl(sock->fd, F_GETFL, 0);
fl |= O_NONBLOCK;
if (!sock->registered && !(flags & ULOOP_BLOCKING)) {
fl = fcntl(sock->fd, F_GETFL, 0);
fl |= O_NONBLOCK;