From 0fcf6f2e4143a8cd1c54c173d1836a08572c3758 Mon Sep 17 00:00:00 2001 From: Fotis Panagiotopoulos Date: Wed, 2 Aug 2023 13:07:15 +0300 Subject: [PATCH] open: Use file mode only when O_CREAT is specified. --- fs/vfs/fs_open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/vfs/fs_open.c b/fs/vfs/fs_open.c index a8ba7398ac..b2119a7ba7 100644 --- a/fs/vfs/fs_open.c +++ b/fs/vfs/fs_open.c @@ -89,7 +89,7 @@ static int file_vopen(FAR struct file *filep, FAR const char *path, /* If the file is opened for creation, then get the mode bits */ - if ((oflags & (O_WRONLY | O_CREAT)) != 0) + if ((oflags & O_CREAT) != 0) { mode = va_arg(ap, mode_t); }