lib: posix:fs: handle O_TRUNC in open()

handling of O_TRUNC flag from posix open()
to zephyr filesystem flag

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
This commit is contained in:
Karthikeyan Krishnasamy 2024-09-09 17:18:39 +05:30 committed by Carles Cufí
parent 20288c254b
commit 063d938aa5
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ static int posix_mode_to_zephyr(int mf)
int mode = (mf & O_CREAT) ? FS_O_CREATE : 0;
mode |= (mf & O_APPEND) ? FS_O_APPEND : 0;
mode |= (mf & O_TRUNC) ? FS_O_TRUNC : 0;
switch (mf & O_ACCMODE) {
case O_RDONLY: