!1009 fix:重复打印log

Merge pull request !1009 from Mupceet/initbug
This commit is contained in:
openharmony_ci 2022-08-02 11:14:56 +00:00 committed by Gitee
commit 9d9685e55e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 2 deletions

View File

@ -164,10 +164,10 @@ static int SelinuxReadParamCheck(const char *name)
if (label == NULL) { // open file with readonly
ret = AddWorkSpace(WORKSPACE_NAME_DEF_SELINUX, 1, PARAM_WORKSPACE_MAX);
} else {
PARAM_LOGI("SelinuxReadParamCheck name %s label %s", name, label);
ret = AddWorkSpace(label, 1, PARAM_WORKSPACE_MAX);
}
if (ret != 0) {
PARAM_LOGV("SelinuxReadParamCheck name %s label %s ", name, label);
return DAC_RESULT_FORBIDED;
}
return DAC_RESULT_PERMISSION;

View File

@ -129,7 +129,7 @@ int32_t WatcherManagerKits::AddWatcher(const std::string &keyPrefix, ParameterCh
{
WATCHER_LOGI("AddWatcher keyPrefix %s", keyPrefix.c_str());
ParamWatcherKitPtr watcher = GetParamWatcher(keyPrefix);
WATCHER_CHECK(watcher == nullptr, return watcher->GetWatcherId(),
WATCHER_CHECK(watcher == nullptr, return -1,
"Has been watched by keyPrefix %s", keyPrefix.c_str());
watcher = new ParamWatcher(keyPrefix, callback, context);