From 72cf8cfcc59f792ff48eb28c3f760678dc10090c Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Tue, 30 Jul 2024 21:31:51 +0530 Subject: tests: init --- src/jobs.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/jobs.c') diff --git a/src/jobs.c b/src/jobs.c index 845df08..cb5fe3b 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -332,15 +332,16 @@ int job_read(FILE *stream, struct job **job) goto out_free; } - temp = cJSON_GetObjectItemCaseSensitive(root, "system"); - if (!cJSON_IsString(temp)) { - ret = JOB_READ_JSON_INVAL; - goto out_free; - } - if (evanix_opts.system != NULL && - strcmp(evanix_opts.system, temp->valuestring)) { - ret = JOB_READ_SYS_MISMATCH; - goto out_free; + if (evanix_opts.system != NULL) { + temp = cJSON_GetObjectItemCaseSensitive(root, "system"); + if (!cJSON_IsString(temp)) { + ret = JOB_READ_JSON_INVAL; + goto out_free; + } + if (strcmp(evanix_opts.system, temp->valuestring)) { + ret = JOB_READ_SYS_MISMATCH; + goto out_free; + } } temp = cJSON_GetObjectItemCaseSensitive(root, "name"); -- cgit v1.2.3