Skip to content

Commit d2df047

Browse files
committed
Fix O_APPEND regression in fatfs
1 parent 2cce206 commit d2df047

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/fs/fatfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,12 @@ int fatfs_write(struct fnode *fno, const void *buf, unsigned int len)
790790

791791
if (priv->flags & O_APPEND) {
792792
off = fno->size;
793+
cur_off = off;
793794
} else {
794795
off = cur_off;
795796
}
796797

797-
task_fd_set_off(fno, off);
798+
task_fd_set_off(fno, cur_off);
798799

799800
sect = off / fs->bps;
800801
off = off & (fs->bps - 1);

0 commit comments

Comments
 (0)