Skip to content

Commit d827ee5

Browse files
gneworldxiaoxiang781216
authored andcommitted
refine: set file mode when oflags contains O_CREAT
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
1 parent 582e0ab commit d827ee5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

arch/arm/src/cxd56xx/cxd56_nxaudio_src.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,10 @@ int cxd56_src_init(struct cxd56_dev_s *dev,
446446
#ifdef DUMP_DATA
447447
nx_unlink(dump_name_pre);
448448
nx_unlink(dump_name_post);
449-
file_open(&dump_file_pre, dump_name_pre, O_WRONLY | O_CREAT | O_APPEND);
450-
file_open(&dump_file_post, dump_name_post, O_WRONLY | O_CREAT | O_APPEND);
449+
file_open(&dump_file_pre, dump_name_pre, O_WRONLY | O_CREAT | O_APPEND,
450+
0666);
451+
file_open(&dump_file_post, dump_name_post, O_WRONLY | O_CREAT | O_APPEND,
452+
0666);
451453
#endif
452454

453455
/* Join any old worker threads to prevent memory leaks */

net/utils/net_snoop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ int snoop_open(FAR struct snoop_s *snoop, FAR const char *filename,
361361
}
362362
}
363363

364-
ret = file_open(&snoop->filep, filename, O_RDWR | O_CREAT | O_CLOEXEC);
364+
ret = file_open(&snoop->filep, filename, O_RDWR | O_CREAT | O_CLOEXEC,
365+
0666);
365366
if (ret < 0)
366367
{
367368
return ret;

0 commit comments

Comments
 (0)