Hopefully fix jansson compatiblity
This commit is contained in:
parent
2a05bdd14c
commit
f4fdf27b6c
1 changed files with 4 additions and 0 deletions
|
@ -783,7 +783,11 @@ static void parse_arg (int key, char *arg)
|
||||||
json_error_t err;
|
json_error_t err;
|
||||||
if (opt_config)
|
if (opt_config)
|
||||||
json_decref(opt_config);
|
json_decref(opt_config);
|
||||||
|
#if JANSSON_VERSION_HEX >= 0x020000
|
||||||
|
opt_config = json_load_file(arg, 0, &err);
|
||||||
|
#else
|
||||||
opt_config = json_load_file(arg, &err);
|
opt_config = json_load_file(arg, &err);
|
||||||
|
#endif
|
||||||
if (!json_is_object(opt_config)) {
|
if (!json_is_object(opt_config)) {
|
||||||
applog(LOG_ERR, "JSON decode of %s failed", arg);
|
applog(LOG_ERR, "JSON decode of %s failed", arg);
|
||||||
show_usage();
|
show_usage();
|
||||||
|
|
Loading…
Reference in a new issue