blobmsg: constify and add more validation
[project/libubox.git] / uloop.c
diff --git a/uloop.c b/uloop.c
index ec37925..a263a01 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -236,7 +236,7 @@ int uloop_fd_add(struct uloop_fd *sock, unsigned int flags)
        unsigned int fl;
        int ret;
 
-       if (!sock->registered) {
+       if (!sock->registered && !(flags & ULOOP_BLOCKING)) {
                fl = fcntl(sock->fd, F_GETFL, 0);
                fl |= O_NONBLOCK;
                fcntl(sock->fd, F_SETFL, fl);