json 0.12 fixes
authorJohn Crispin <blogic@openwrt.org>
Fri, 6 Mar 2015 16:46:04 +0000 (17:46 +0100)
committerJohn Crispin <blogic@openwrt.org>
Fri, 6 Mar 2015 16:46:23 +0000 (17:46 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
CMakeLists.txt
plug/hotplug.c
service/validate.c

index 54146773c5f5af6c98cbe77e05e110318baa8afc..98395f5c64212b43a0d058592feb7d78265bd002 100644 (file)
@@ -14,8 +14,7 @@ SET(SOURCES procd.c signal.c watchdog.c state.c       inittab.c rcS.c ubus.c system.c
        service/service.c service/instance.c service/validate.c service/trigger.c service/watch.c
        plug/coldplug.c plug/hotplug.c utils/utils.c)
 
-find_library(json NAMES json-c json)
-SET(LIBS ubox ubus ${json} blobmsg_json json_script)
+SET(LIBS ubox ubus json-c blobmsg_json json_script)
 
 IF(DEBUG)
   ADD_DEFINITIONS(-DDEBUG -g3)
index 061833a887449f4b541219b97cc8a7afc4b26570..6df79717bd36cfffcb8dff90899869dd3db30eb5 100644 (file)
@@ -22,7 +22,7 @@
 #include <libubox/blobmsg_json.h>
 #include <libubox/json_script.h>
 #include <libubox/uloop.h>
-#include <json/json.h>
+#include <json-c/json.h>
 
 #include <fcntl.h>
 #include <unistd.h>
index a33a48e4a7bb0d97e98446dcf6cd66f8fc9d677e..6a449f43bd875d3809aeab707d211cd932291d27 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <libubox/blobmsg_json.h>
 #include <libubox/avl-cmp.h>
-#include <json/json.h>
+#include <json-c/json.h>
 
 #include "../procd.h"
 
@@ -53,12 +53,12 @@ service_validate_dump_all(struct blob_buf *b, char *p, char *s)
                if (s && strcmp(s, v->type))
                        continue;
 
-               o = json_object_object_get(r, v->package);
+               json_object_object_get_ex(r, v->package, &o);
                if (!o) {
                        o = json_object_new_object();
                        json_object_object_add(r, v->package, o);
                }
-               t = json_object_object_get(o, v->type);
+               json_object_object_get_ex(o, v->type, &t);
                if (!t) {
                        t = json_object_new_object();
                        json_object_object_add(o, v->type, t);