mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
Added ftruncate().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2827 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
228605dc7b
commit
68640edf90
3 changed files with 33 additions and 4 deletions
|
|
@ -1002,12 +1002,15 @@ int fat_truncate(struct fat_file *file)
|
|||
{
|
||||
/* truncate trailing clusters */
|
||||
int next;
|
||||
int last = get_next_cluster(file->lastcluster);
|
||||
while ( last && last != FAT_EOF_MARK ) {
|
||||
int last = file->lastcluster;
|
||||
|
||||
LDEBUGF("fat_truncate(%x, %x)\n", file->firstcluster, last);
|
||||
|
||||
for ( last = get_next_cluster(last); last; last = next ) {
|
||||
next = get_next_cluster(last);
|
||||
update_fat_entry(last,0);
|
||||
last = next;
|
||||
}
|
||||
update_fat_entry(file->lastcluster,FAT_EOF_MARK);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue