修改rpcid.sc没生成的bug

Signed-off-by: liutuantuan <liutuantuan1@huawei.com>
This commit is contained in:
liutuantuan
2024-05-29 10:29:26 +08:00
parent d81d932145
commit ab01f059f1
+4 -5
View File
@@ -161,7 +161,8 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath)
FREE_CONTEXT_OUT_RPCID_ENCODE, -1);
}
if (cJSON_GetArraySize(gJsonObjectSysCap.sysCapPtr) < 0) {
ret = cJSON_GetArraySize(gJsonObjectSysCap.sysCapPtr);
if (ret < 0) {
PRINT_ERR("get \"syscap\" array size failed\n");
return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, NULL, contextBuffer,
FREE_CONTEXT_OUT_RPCID_ENCODE, -1);
@@ -179,13 +180,11 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath)
}
(void) memset_s(convertedBuffer, convertedBufLen, 0, convertedBufLen);
ret = FillOsCapLength(convertedBuffer, contextBuffer, gJsonObjectSysCap, sysCapSize, ret);
if (ret == -1) {
if (FillOsCapLength(convertedBuffer, contextBuffer, gJsonObjectSysCap, sysCapSize, ret) == -1) {
return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer,
FREE_CONVERT_OUT_RPCID_ENCODE, ret);
}
ret = ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen);
if (ret != 0) {
if (ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen) != 0) {
PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.sc\n", outputPath);
}
return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer,