未验证 提交 0768ca1b 编写于 作者: O openharmony_ci 提交者: Gitee

!867 Remove unnecessary logs in sandbox

Merge pull request !867 from handy/062721
...@@ -310,7 +310,6 @@ static int CheckAndMakeDir(const char *dir, mode_t mode) ...@@ -310,7 +310,6 @@ static int CheckAndMakeDir(const char *dir, mode_t mode)
BEGET_LOGW("Mount point \' %s \' already exist", dir); BEGET_LOGW("Mount point \' %s \' already exist", dir);
return 0; return 0;
} else { } else {
BEGET_LOGI("Ready to create dir [%s] now ...", dir);
if (errno == ENOENT) { if (errno == ENOENT) {
BEGET_ERROR_CHECK(MakeDirRecursive(dir, mode) == 0, return -1, BEGET_ERROR_CHECK(MakeDirRecursive(dir, mode) == 0, return -1,
"Failed MakeDirRecursive %s, err=%d", dir, errno); "Failed MakeDirRecursive %s, err=%d", dir, errno);
...@@ -332,7 +331,7 @@ static int BindMount(const char *source, const char *target, unsigned long flags ...@@ -332,7 +331,7 @@ static int BindMount(const char *source, const char *target, unsigned long flags
unsigned long tmpflags = flags; unsigned long tmpflags = flags;
mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
if (tag == SANDBOX_TAG_MOUNT_PATH) { if (tag == SANDBOX_TAG_MOUNT_PATH) {
CheckAndMakeDir(target, mode); BEGET_ERROR_CHECK(CheckAndMakeDir(target, mode) == 0, return -1, "Failed make %s dir.", target);
} else if (tag == SANDBOX_TAG_MOUNT_FILE) { } else if (tag == SANDBOX_TAG_MOUNT_FILE) {
BEGET_ERROR_CHECK(CheckAndCreatFile(target, mode) == 0, return -1, "Failed make %s file.", target); BEGET_ERROR_CHECK(CheckAndCreatFile(target, mode) == 0, return -1, "Failed make %s file.", target);
} else { } else {
...@@ -375,7 +374,6 @@ static int MountSandboxInfo(const mountlist_t *mounts, const char *rootPath, San ...@@ -375,7 +374,6 @@ static int MountSandboxInfo(const mountlist_t *mounts, const char *rootPath, San
if (mounts == NULL) { if (mounts == NULL) {
return 0; return 0;
} }
BEGET_LOGI("MountSandboxInfo now ...");
BEGET_CHECK(mounts->info != NULL, return 0); BEGET_CHECK(mounts->info != NULL, return 0);
while (mounts != NULL) { while (mounts != NULL) {
mount_t *mount = mounts->info; mount_t *mount = mounts->info;
...@@ -383,7 +381,6 @@ static int MountSandboxInfo(const mountlist_t *mounts, const char *rootPath, San ...@@ -383,7 +381,6 @@ static int MountSandboxInfo(const mountlist_t *mounts, const char *rootPath, San
char target[PATH_MAX] = {}; char target[PATH_MAX] = {};
BEGET_ERROR_CHECK(!(snprintf_s(target, PATH_MAX, PATH_MAX - 1, "%s%s", rootPath, mount->target) < 0), BEGET_ERROR_CHECK(!(snprintf_s(target, PATH_MAX, PATH_MAX - 1, "%s%s", rootPath, mount->target) < 0),
return -1, "Failed snprintf_s err=%d", errno); return -1, "Failed snprintf_s err=%d", errno);
BEGET_LOGI("Do BindMount from [%s] to [%s] now ...", source, target);
int rc = BindMount(source, target, mount->flags, tag); int rc = BindMount(source, target, mount->flags, tag);
if (rc != 0) { if (rc != 0) {
BEGET_LOGW("Failed bind mount %s to %s.", source, target); BEGET_LOGW("Failed bind mount %s to %s.", source, target);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册