mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-27 01:28:23 +00:00
fix O_APPEND write issue in RAMFS
This commit is contained in:
@@ -264,7 +264,10 @@ int dfs_ramfs_open(struct dfs_fd *file)
|
||||
|
||||
file->data = dirent;
|
||||
file->size = dirent->size;
|
||||
file->pos = 0;
|
||||
if (file->flags & DFS_O_APPEND)
|
||||
file->pos = file->size;
|
||||
else
|
||||
file->pos = 0;
|
||||
|
||||
return DFS_STATUS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user