!887 【OpenHarmony开源贡献者计划2022】fix warning: variable 'ret' set but not used

Merge pull request !887 from rtos_ming/unused-but-set-variable
This commit is contained in:
openharmony_ci 2022-07-04 04:10:32 +00:00 committed by Gitee
commit 7ae4c5ae36
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -200,12 +200,11 @@ int LoadDefaultParams(const char *fileName, uint32_t mode)
{
PARAM_CHECK(fileName != NULL, return -1, "Invalid filename for load");
PARAM_LOGI("load default parameters %s.", fileName);
int ret = 0;
struct stat st;
if ((stat(fileName, &st) == 0) && !S_ISDIR(st.st_mode)) {
ret = ProcessParamFile(fileName, &mode);
(void)ProcessParamFile(fileName, &mode);
} else {
ret = ReadFileInDir(fileName, ".para", ProcessParamFile, &mode);
(void)ReadFileInDir(fileName, ".para", ProcessParamFile, &mode);
}
// load security label