From f32154f9cb32d88cd62f220986826005e26b2a72 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Thu, 4 Nov 2021 15:02:42 +0800 Subject: [PATCH] fixed f360b21 from https://gitee.com/mgce/kernel_liteos_a/pulls/698 add blackbox to 2.3 Signed-off-by: YOUR_NAME --- kernel/common/blackbox/los_blackbox_common.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/common/blackbox/los_blackbox_common.c b/kernel/common/blackbox/los_blackbox_common.c index 18cc1d2f..39a9e38b 100644 --- a/kernel/common/blackbox/los_blackbox_common.c +++ b/kernel/common/blackbox/los_blackbox_common.c @@ -43,7 +43,8 @@ /* ------------ local macroes ------------ */ #ifdef LOSCFG_FS_VFS -#define BBOX_DIR_MODE 0777 +#define BBOX_DIR_MODE 0750 +#define BBOX_FILE_MODE 0640 #endif /* ------------ local prototypes ------------ */ @@ -69,7 +70,7 @@ int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isA BBOX_PRINT_ERR("log path [%s] isn't ready to be written!\n", LOSCFG_BLACKBOX_LOG_ROOT_PATH); return -1; } - fd = open(filePath, O_CREAT | O_RDWR | (isAppend ? O_APPEND : O_TRUNC), 0644); + fd = open(filePath, O_CREAT | O_RDWR | (isAppend ? O_APPEND : O_TRUNC), BBOX_FILE_MODE); if (fd < 0) { BBOX_PRINT_ERR("Create file [%s] failed, fd: %d!\n", filePath, fd); return -1; @@ -216,4 +217,4 @@ int CreateLogDir(const char *dirPath) (void)dirPath; return -1; } -#endif \ No newline at end of file +#endif -- GitLab