diff --git a/lfs.c b/lfs.c index 88e57f2e..d99a5948 100644 --- a/lfs.c +++ b/lfs.c @@ -9760,18 +9760,18 @@ static inline bool lfsr_o_isappend(uint32_t flags) { return flags & LFS_O_APPEND; } +static inline bool lfsr_o_isflush(uint32_t flags) { + return flags & LFS_O_FLUSH; +} + static inline bool lfsr_o_issync(uint32_t flags) { - return flags & LFS_O_SYNC; + return flags & (LFS_O_SYNC ^ LFS_O_FLUSH); } static inline bool lfsr_o_isdesync(uint32_t flags) { return flags & LFS_O_DESYNC; } -static inline bool lfsr_o_isflush(uint32_t flags) { - return flags & LFS_O_FLUSH; -} - static inline bool lfsr_f_isunflush(uint32_t flags) { return flags & LFS_F_UNFLUSH; } diff --git a/lfs.h b/lfs.h index 33b605a8..3c1bff24 100644 --- a/lfs.h +++ b/lfs.h @@ -137,9 +137,9 @@ enum lfs_open_flags { LFS_O_EXCL = 0x0008, // Fail if a file already exists LFS_O_TRUNC = 0x0010, // Truncate the existing file to zero size LFS_O_APPEND = 0x0020, // Move to end of file on every write - LFS_O_SYNC = 0x0040, // Sync metadata on every write - LFS_O_DESYNC = 0x0080, // Do not sync or recieve file updates - LFS_O_FLUSH = 0x0100, // Flush data on every write + LFS_O_FLUSH = 0x0040, // Flush data on every write + LFS_O_SYNC = 0x00c0, // Sync metadata on every write + LFS_O_DESYNC = 0x0100, // Do not sync or recieve file updates #endif // internally used flags