open: Use file mode only when O_CREAT is specified.

This commit is contained in:
Fotis Panagiotopoulos 2023-08-02 13:07:15 +03:00 committed by Xiang Xiao
parent bace5e9b59
commit 0fcf6f2e41

View File

@ -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);
}