make procd wait for ubus to come up
[project/procd.git] / plug / hotplug.c
index ef98f38..061833a 100644 (file)
@@ -22,6 +22,7 @@
 #include <libubox/blobmsg_json.h>
 #include <libubox/json_script.h>
 #include <libubox/uloop.h>
+#include <json/json.h>
 
 #include <fcntl.h>
 #include <unistd.h>
@@ -335,7 +336,7 @@ rule_handle_file(struct json_script_ctx *ctx, const char *name)
        json_object *obj;
 
        obj = json_object_from_file((char*)name);
-       if (is_error(obj))
+       if (!obj)
                return NULL;
 
        blob_buf_init(&script, 0);