Skip to content

Commit

Permalink
pkg/fatfs/fatfs_vfs: fix flag translation in _open
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-hm committed Jun 29, 2020
1 parent 05352b6 commit 4469d8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/fatfs/fatfs_vfs/fatfs_vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ static int _open(vfs_file_t *filp, const char *name, int flags, mode_t mode,
fatfs_flags |= FA_CREATE_ALWAYS;
}
if ((flags & O_CREAT) == O_CREAT) {
fatfs_flags |= FA_CREATE_NEW;
if ((flags & O_EXCL) == O_EXCL) {
fatfs_flags |= FA_CREATE_NEW;
}
else {
fatfs_flags |= FA_OPEN_ALWAYS;
}
}
else {
fatfs_flags |= FA_OPEN_EXISTING;
Expand Down

0 comments on commit 4469d8f

Please sign in to comment.