In json-c-0.12 is_error() is defined in bits.h which is exported via
json.h. However, json-c's master branch contains commit d4e81f9ec827
which declares bits.h deprecated and removes the export via json.h.
Replace the use of is_error() with its trivial implementation to be
able to get rid of this single dependency towards the deprecated
bits.h.
This fixes an issue introduced by commit 17dd99c72a12 ("Clean-up header
file inferno") which removed #include <json-c/bits.h> from
src/rt-app_parse_config.c.
Cc: Olav Haugan <ohaugan(a)codeaurora.org>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann(a)arm.com>
---
Hi Juri and Vincent,
Olav had problems to build rt-app against json-c library (master ?). I
didn't spot the error since I used json-c-0.12 when testing
17dd99c72a12. Can you please integrate this little snippet so we can
build against master json-c as well? I didn't want to include a
deprecated header file.
Cheers,
Dietmar
src/rt-app_parse_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c
index c6086f423d2e..a6e3b591988f 100644
--- a/src/rt-app_parse_config.c
+++ b/src/rt-app_parse_config.c
@@ -895,7 +895,7 @@ get_opts_from_json_object(struct json_object *root, rtapp_options_t *opts)
{
struct json_object *global, *tasks, *resources;
- if (is_error(root)) {
+ if (root == NULL) {
log_error(PFX "Error while parsing input JSON");
exit(EXIT_INV_CONFIG);
}
--
2.11.0
According to documentation the default value of 'loop' is -1, but the
threads without a loop field runs only once and stops.
Fix it.
Fixes: 3bda96e6e664 ("add phase feature")
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
V2: Fixed at a different place and updated Fixes tag as well.
src/rt-app_parse_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c
index e5ef87f6ee3e..f06b32162b20 100644
--- a/src/rt-app_parse_config.c
+++ b/src/rt-app_parse_config.c
@@ -734,7 +734,7 @@ parse_thread_data(char *name, struct json_object *obj, int index,
data->phases = malloc(sizeof(phase_data_t) * data->nphases);
parse_thread_phase_data(obj, &data->phases[0], opts, (long)data);
/* Get loop number */
- data->loop = 1;
+ data->loop = -1;
}
}
--
2.7.1.410.g6faf27b
According to documentation the default value of 'loop' is -1, but the
threads without a loop field runs only once and stops. This was broken
long back, perhaps unintentionally though.
Fix it.
Fixes: 82dae3e5ee2f ("simplify the grammar")
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
src/rt-app_parse_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c
index e5ef87f6ee3e..96bd2d299389 100644
--- a/src/rt-app_parse_config.c
+++ b/src/rt-app_parse_config.c
@@ -605,7 +605,7 @@ parse_thread_phase_data(struct json_object *obj,
int i;
/* loop */
- data->loop = get_int_value_from(obj, "loop", TRUE, 1);
+ data->loop = get_int_value_from(obj, "loop", TRUE, -1);
/* Count number of events */
data->nbevents = 0;
--
2.7.1.410.g6faf27b