diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-07-30 21:31:51 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-07-30 21:59:39 +0530 |
commit | 72cf8cfcc59f792ff48eb28c3f760678dc10090c (patch) | |
tree | 1aca1af04efe127296bbb5b134babb904a3dbf19 /src/jobs.c | |
parent | 1778164794b39d2613b02783bef9beee683de866 (diff) |
tests: init
Diffstat (limited to 'src/jobs.c')
-rw-r--r-- | src/jobs.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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"); |