提交 62aa4aa0 编写于 作者: O openharmony_ci 提交者: Gitee

!725 Codex警告清零

Merge pull request !725 from yinjiaming/yjm-kernel-fs-20211203
...@@ -53,6 +53,9 @@ extern "C" { ...@@ -53,6 +53,9 @@ extern "C" {
typedef unsigned short fmode_t; typedef unsigned short fmode_t;
#define PROC_ERROR (-1) #define PROC_ERROR (-1)
/* Default file mode for procfs */
#define PROCFS_DEFAULT_MODE 0550
/* 64bit hashes as llseek() offset (for directories) */ /* 64bit hashes as llseek() offset (for directories) */
#define FMODE_64BITHASH ((fmode_t)0x400) #define FMODE_64BITHASH ((fmode_t)0x400)
/* 32bit hashes as llseek() offset (for directories) */ /* 32bit hashes as llseek() offset (for directories) */
......
...@@ -45,7 +45,7 @@ void ProcFsInit(void) ...@@ -45,7 +45,7 @@ void ProcFsInit(void)
{ {
int ret; int ret;
ret = mkdir(PROCFS_MOUNT_POINT, 0); ret = mkdir(PROCFS_MOUNT_POINT, PROCFS_DEFAULT_MODE);
if (ret < 0) { if (ret < 0) {
PRINT_ERR("failed to mkdir %s, errno = %d\n", PROCFS_MOUNT_POINT, get_errno()); PRINT_ERR("failed to mkdir %s, errno = %d\n", PROCFS_MOUNT_POINT, get_errno());
return; return;
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
#include "los_tables.h" #include "los_tables.h"
#include "internal.h" #include "internal.h"
#define PROCFS_DEFAULT_MODE 0555
#ifdef LOSCFG_FS_PROC #ifdef LOSCFG_FS_PROC
static struct VnodeOps g_procfsVops; static struct VnodeOps g_procfsVops;
static struct file_operations_vfs g_procfsFops; static struct file_operations_vfs g_procfsFops;
......
...@@ -49,7 +49,7 @@ static struct ProcFile g_procPf = { ...@@ -49,7 +49,7 @@ static struct ProcFile g_procPf = {
static struct ProcDirEntry g_procRootDirEntry = { static struct ProcDirEntry g_procRootDirEntry = {
.nameLen = 5, .nameLen = 5,
.mode = S_IFDIR | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH, .mode = S_IFDIR | PROCFS_DEFAULT_MODE,
.count = ATOMIC_INIT(1), .count = ATOMIC_INIT(1),
.procFileOps = NULL, .procFileOps = NULL,
.parent = &g_procRootDirEntry, .parent = &g_procRootDirEntry,
......
...@@ -307,7 +307,7 @@ int SysOpen(const char *path, int oflags, ...) ...@@ -307,7 +307,7 @@ int SysOpen(const char *path, int oflags, ...)
goto ERROUT; goto ERROUT;
} }
if (oflags & O_CLOEXEC) { if ((unsigned int)oflags & O_CLOEXEC) {
SetCloexecFlag(procFd); SetCloexecFlag(procFd);
} }
...@@ -1640,7 +1640,7 @@ int SysOpenat(int dirfd, const char *path, int oflags, ...) ...@@ -1640,7 +1640,7 @@ int SysOpenat(int dirfd, const char *path, int oflags, ...)
goto ERROUT; goto ERROUT;
} }
if (oflags & O_CLOEXEC) { if ((unsigned int)oflags & O_CLOEXEC) {
SetCloexecFlag(procFd); SetCloexecFlag(procFd);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册