Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lfs.c
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2022-03-21 07:16:15 +0300
committerChristopher Haster <chaster@utexas.edu>2022-03-21 07:16:15 +0300
commitc676bcee4ca9a2e8bccd888608598251b75c5980 (patch)
treecd4cc48d300d46baaa53a8bd2d71aa3d3139fe2b /lfs.c
parent99f58139cb48eab4ea6121a6e25511192778ef17 (diff)
parent03f088b92c024bd64b2635d3d6896403514fb9b7 (diff)
Merge branch 'bf_lfs_file_seek_readonly' into HEAD
Diffstat (limited to 'lfs.c')
-rw-r--r--lfs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lfs.c b/lfs.c
index 43a577c..d7c692d 100644
--- a/lfs.c
+++ b/lfs.c
@@ -2742,7 +2742,6 @@ static int lfs_file_outline(lfs_t *lfs, lfs_file_t *file) {
}
#endif
-#ifndef LFS_READONLY
static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
if (file->flags & LFS_F_READING) {
if (!(file->flags & LFS_F_INLINE)) {
@@ -2751,6 +2750,7 @@ static int lfs_file_flush(lfs_t *lfs, lfs_file_t *file) {
file->flags &= ~LFS_F_READING;
}
+#ifndef LFS_READONLY
if (file->flags & LFS_F_WRITING) {
lfs_off_t pos = file->pos;
@@ -2817,10 +2817,10 @@ relocate:
file->pos = pos;
}
+#endif
return 0;
}
-#endif
#ifndef LFS_READONLY
static int lfs_file_rawsync(lfs_t *lfs, lfs_file_t *file) {
@@ -3093,13 +3093,11 @@ static lfs_soff_t lfs_file_rawseek(lfs_t *lfs, lfs_file_t *file,
return npos;
}
-#ifndef LFS_READONLY
// write out everything beforehand, may be noop if rdonly
int err = lfs_file_flush(lfs, file);
if (err) {
return err;
}
-#endif
// update pos
file->pos = npos;