Add a return value to make compiler silent.
[oweals/ubus.git] / libubus-io.c
index 4ebb8fbeecc06f97e8d982e304e130145a174fa9..1f7b0fb6d0076a813eae9a59a6e66a9c32b703cc 100644 (file)
@@ -33,6 +33,9 @@ static const struct blob_attr_info ubus_policy[UBUS_ATTR_MAX] = {
        [UBUS_ATTR_OBJID] = { .type = BLOB_ATTR_INT32 },
        [UBUS_ATTR_OBJPATH] = { .type = BLOB_ATTR_STRING },
        [UBUS_ATTR_METHOD] = { .type = BLOB_ATTR_STRING },
+       [UBUS_ATTR_ACTIVE] = { .type = BLOB_ATTR_INT8 },
+       [UBUS_ATTR_NO_REPLY] = { .type = BLOB_ATTR_INT8 },
+       [UBUS_ATTR_SUBSCRIBERS] = { .type = BLOB_ATTR_NESTED },
 };
 
 static struct blob_attr *attrbuf[UBUS_ATTR_MAX];
@@ -74,11 +77,14 @@ static int writev_retry(int fd, struct iovec *iov, int iov_len)
                        cur_len -= iov->iov_len;
                        iov_len--;
                        iov++;
-                       if (!cur_len || !iov_len)
+                       if (!iov_len)
                                return len;
                }
                iov->iov_len -= cur_len;
        } while (1);
+
+       /* Should never reach here */
+       return -1;
 }
 
 int __hidden ubus_send_msg(struct ubus_context *ctx, uint32_t seq,
@@ -187,7 +193,8 @@ ubus_refresh_state(struct ubus_context *ctx)
 
        /* clear all type IDs, they need to be registered again */
        avl_for_each_element(&ctx->objects, obj, avl)
-               obj->type->id = 0;
+               if (obj->type)
+                       obj->type->id = 0;
 
        /* push out all objects again */
        avl_for_each_element_safe(&ctx->objects, obj, avl, tmp) {