enable O_CLOEXEC explicit

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
wanggang26
2023-09-22 13:51:00 +08:00
committed by Xiang Xiao
parent 2d817deecb
commit e930476b4b
25 changed files with 41 additions and 35 deletions
+1 -1
View File
@@ -749,7 +749,7 @@ FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset,
/* Set the file open mode. */
mode = O_RDOK | O_WROK;
mode = O_RDOK | O_WROK | O_CLOEXEC;
/* Try to open the file. NOTE that block devices will use a character
* driver proxy.
+2 -1
View File
@@ -37,6 +37,7 @@
#include <stdbool.h>
#include <string.h>
#include <poll.h>
#include <fcntl.h>
#include <assert.h>
#include <errno.h>
#include <debug.h>
@@ -1801,7 +1802,7 @@ int mtdconfig_unregister(void)
FAR struct inode *inode;
FAR struct mtdconfig_struct_s *dev;
ret = file_open(&file, "/dev/config", 0);
ret = file_open(&file, "/dev/config", O_CLOEXEC);
if (ret < 0)
{
ferr("ERROR: open /dev/config failed: %d\n", ret);
+1 -1
View File
@@ -2081,7 +2081,7 @@ int mtdconfig_unregister_by_path(FAR const char *path)
FAR struct inode *inode;
FAR struct nvs_fs *fs;
ret = file_open(&file, path, 0);
ret = file_open(&file, path, O_CLOEXEC);
if (ret < 0)
{
ferr("ERROR: open file %s err: %d\n", path, ret);