refine: set file mode when oflags contains O_CREAT
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
This commit is contained in:
parent
582e0ab51f
commit
d827ee5ffc
@ -446,8 +446,10 @@ int cxd56_src_init(struct cxd56_dev_s *dev,
|
||||
#ifdef DUMP_DATA
|
||||
nx_unlink(dump_name_pre);
|
||||
nx_unlink(dump_name_post);
|
||||
file_open(&dump_file_pre, dump_name_pre, O_WRONLY | O_CREAT | O_APPEND);
|
||||
file_open(&dump_file_post, dump_name_post, O_WRONLY | O_CREAT | O_APPEND);
|
||||
file_open(&dump_file_pre, dump_name_pre, O_WRONLY | O_CREAT | O_APPEND,
|
||||
0666);
|
||||
file_open(&dump_file_post, dump_name_post, O_WRONLY | O_CREAT | O_APPEND,
|
||||
0666);
|
||||
#endif
|
||||
|
||||
/* Join any old worker threads to prevent memory leaks */
|
||||
|
@ -361,7 +361,8 @@ int snoop_open(FAR struct snoop_s *snoop, FAR const char *filename,
|
||||
}
|
||||
}
|
||||
|
||||
ret = file_open(&snoop->filep, filename, O_RDWR | O_CREAT | O_CLOEXEC);
|
||||
ret = file_open(&snoop->filep, filename, O_RDWR | O_CREAT | O_CLOEXEC,
|
||||
0666);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user