【背景】
codex 告警清零 【修改方案】 修改和添加了procfs的默认文件模式的宏定义,对进行位操作运算的有符号数进行强制类型转换 【影响】 对现有的产品编译不会有影响。 re #I4KVS7 Signed-off-by: yinjiaming <yinjiaming@huawei.com>
This commit is contained in:
parent
8bb15bf8e7
commit
929a282bad
|
@ -53,6 +53,9 @@ extern "C" {
|
|||
typedef unsigned short fmode_t;
|
||||
#define PROC_ERROR (-1)
|
||||
|
||||
/* Default file mode for procfs */
|
||||
#define PROCFS_DEFAULT_MODE 0550
|
||||
|
||||
/* 64bit hashes as llseek() offset (for directories) */
|
||||
#define FMODE_64BITHASH ((fmode_t)0x400)
|
||||
/* 32bit hashes as llseek() offset (for directories) */
|
||||
|
|
|
@ -45,7 +45,7 @@ void ProcFsInit(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
ret = mkdir(PROCFS_MOUNT_POINT, 0);
|
||||
ret = mkdir(PROCFS_MOUNT_POINT, PROCFS_DEFAULT_MODE);
|
||||
if (ret < 0) {
|
||||
PRINT_ERR("failed to mkdir %s, errno = %d\n", PROCFS_MOUNT_POINT, get_errno());
|
||||
return;
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
#include "los_tables.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define PROCFS_DEFAULT_MODE 0555
|
||||
|
||||
#ifdef LOSCFG_FS_PROC
|
||||
static struct VnodeOps g_procfsVops;
|
||||
static struct file_operations_vfs g_procfsFops;
|
||||
|
|
|
@ -49,7 +49,7 @@ static struct ProcFile g_procPf = {
|
|||
|
||||
static struct ProcDirEntry g_procRootDirEntry = {
|
||||
.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),
|
||||
.procFileOps = NULL,
|
||||
.parent = &g_procRootDirEntry,
|
||||
|
|
|
@ -307,7 +307,7 @@ int SysOpen(const char *path, int oflags, ...)
|
|||
goto ERROUT;
|
||||
}
|
||||
|
||||
if (oflags & O_CLOEXEC) {
|
||||
if ((unsigned int)oflags & O_CLOEXEC) {
|
||||
SetCloexecFlag(procFd);
|
||||
}
|
||||
|
||||
|
@ -1640,7 +1640,7 @@ int SysOpenat(int dirfd, const char *path, int oflags, ...)
|
|||
goto ERROUT;
|
||||
}
|
||||
|
||||
if (oflags & O_CLOEXEC) {
|
||||
if ((unsigned int)oflags & O_CLOEXEC) {
|
||||
SetCloexecFlag(procFd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue