From 473b3ef43aa6dc7b8572347b6badcbe2ee555b1d Mon Sep 17 00:00:00 2001 From: yudechen Date: Thu, 21 Apr 2022 14:39:45 +0800 Subject: [PATCH] fix build error of hispark_taurus_Linux. Signed-off-by: yudechen Change-Id: I5aea87e5bb055b3352d7d0220185903a05ab6564 --- include/create_pcid.h | 1 + interfaces/inner_api/syscap_interface.c | 1 + src/create_pcid.c | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/include/create_pcid.h b/include/create_pcid.h index 2f43282..5baade6 100644 --- a/include/create_pcid.h +++ b/include/create_pcid.h @@ -76,6 +76,7 @@ typedef enum SystemCapabilityNum { HIVIEWDFX_HIVIEW_FAULTLOGGER, I18N, GLOBAL_I18N, + KERNEL_LINUX, KERNEL_LITEOS_A, LOCATION_LOCATION, MISCSERVICES_DOWNLOAD, diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index 32bc897..4a0109d 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -96,6 +96,7 @@ static const SyscapWithNum arraySyscap[] = { {"SystemCapability.HiviewDFX.Hiview.FaultLogger", HIVIEWDFX_HIVIEW_FAULTLOGGER}, {"SystemCapability.I18N", I18N}, {"SystemCapability.Global.I18n", GLOBAL_I18N}, + {"SystemCapability.Kernel.Linux", KERNEL_LINUX}, {"SystemCapability.Kernel.liteos-a", KERNEL_LITEOS_A}, {"SystemCapability.Location.Location", LOCATION_LOCATION}, {"SystemCapability.MiscServices.download", MISCSERVICES_DOWNLOAD}, diff --git a/src/create_pcid.c b/src/create_pcid.c index e97d96a..3153622 100644 --- a/src/create_pcid.c +++ b/src/create_pcid.c @@ -100,6 +100,7 @@ static SyscapWithNum arraySyscap[] = { {"SystemCapability.HiviewDFX.Hiview.FaultLogger", HIVIEWDFX_HIVIEW_FAULTLOGGER}, {"SystemCapability.I18N", I18N}, {"SystemCapability.Global.I18n", GLOBAL_I18N}, + {"SystemCapability.Kernel.Linux", KERNEL_LINUX}, {"SystemCapability.Kernel.liteos-a", KERNEL_LITEOS_A}, {"SystemCapability.Location.Location", LOCATION_LOCATION}, {"SystemCapability.MiscServices.download", MISCSERVICES_DOWNLOAD}, @@ -357,6 +358,11 @@ int32_t CreatePCID(char *inputFile, char *outDirPath) for (i = 0; i < osCapSize; i++) { jsonArrayItem = cJSON_GetArrayItem(jsonOsSyscapObj, i); osCapIndex = cJSON_GetObjectItem(allOsSyscapObj, jsonArrayItem->valuestring); + if (osCapIndex == NULL) { + PRINT_ERR("can't find the syscap: %s, please checkout.\n", jsonArrayItem->valuestring); + ret = -1; + goto FREE_CONVERT_OUT; + } sectorOfBits = (osCapIndex->valueint) / BITS_OF_ONE_BYTE; posOfBits = (osCapIndex->valueint) % BITS_OF_ONE_BYTE; if (sectorOfBits >= BYTES_OF_OS_SYSCAP) { -- Gitee