libubox: make uloop_fd::flags generic
authorFelix Fietkau <nbd@openwrt.org>
Tue, 18 Jun 2013 09:11:04 +0000 (11:11 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 18 Jun 2013 10:05:09 +0000 (12:05 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uloop.c
uloop.h

diff --git a/uloop.c b/uloop.c
index 37465203cc478f413abde4a833ee3f20ed069d6d..ed7d87a90da0bd45737b54e34a5575f5f76166d5 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -230,6 +230,7 @@ static int register_poll(struct uloop_fd *fd, unsigned int flags)
 
        ev.data.fd = fd->fd;
        ev.data.ptr = fd;
+       fd->flags = flags;
 
        return epoll_ctl(poll_fd, op, fd->fd, &ev);
 }
@@ -238,6 +239,7 @@ static struct epoll_event events[ULOOP_MAX_EVENTS];
 
 static int __uloop_fd_delete(struct uloop_fd *sock)
 {
+       sock->flags = 0;
        return epoll_ctl(poll_fd, EPOLL_CTL_DEL, sock->fd, 0);
 }
 
diff --git a/uloop.h b/uloop.h
index 975e40ba0e3c1ae226f061db015e1d9038525a8d..39b9b582336efe7780ea6c36a6f24c77277c963f 100644 (file)
--- a/uloop.h
+++ b/uloop.h
@@ -55,9 +55,7 @@ struct uloop_fd
        bool eof;
        bool error;
        bool registered;
-#ifdef USE_KQUEUE
        uint8_t flags;
-#endif
 };
 
 struct uloop_timeout