Added tests, cleanup, and fixed a small issue with updating file flags

Related to changes to custom attribute and open file syncing
This commit is contained in:
Christopher Haster
2020-12-24 12:08:23 -06:00
parent 026833214a
commit deeaa17317
3 changed files with 274 additions and 11 deletions

3
lfs.c
View File

@@ -2527,6 +2527,7 @@ static int lfs_file_rawopencfg(lfs_t *lfs, lfs_file_t *file,
#ifndef LFS_READONLY
} else if (flags & LFS_O_TRUNC) {
// truncate if requested
// always mark dirty in case we have custom attributes
tag = LFS_MKTAG(LFS_TYPE_INLINESTRUCT, file->id, 0);
file->flags |= LFS_F_DIRTY;
#endif
@@ -2878,7 +2879,7 @@ static int lfs_file_rawsync(lfs_t *lfs, lfs_file_t *file) {
}
}
file->flags &= ~(LFS_F_DIRTY | LFS_F_WRITING | LFS_F_READING);
f->flags &= ~(LFS_F_DIRTY | LFS_F_WRITING | LFS_F_READING);
}
}