mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-16 10:39:49 +00:00
Refactor ff_open()
This commit is contained in:
1 parent
4a5824e7a7
commit
fbf5fa53c6
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -33,8 +33,8 @@ static void ff_list(const char *dir, void (*fn)(const char *, void *),
|
||||
|
||||
static void *ff_open(const char *path, int flags) {
|
||||
FIL f;
|
||||
unsigned char mode =
|
||||
flags == MG_FS_READ ? FA_READ : FA_READ | FA_WRITE | FA_OPEN_APPEND;
|
||||
unsigned char mode = FA_READ;
|
||||
if (flags & MG_FS_WRITE) mode |= FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_APPEND;
|
||||
if (f_open(&f, path, mode) == 0) {
|
||||
FIL *fp = calloc(1, sizeof(*fp));
|
||||
*fp = f;
|
||||
|
||||
Reference in new issue
Block a user