From d2f90c9a74f89c4af0c240d13930990828c833a5 Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Thu, 19 Dec 2002 00:51:39 +0000 Subject: Use flush_cache() when writing headbytes to disk to make sure we are on the correct sector. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3023 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/file.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'firmware') diff --git a/firmware/common/file.c b/firmware/common/file.c index 1d78dcb456..644019effc 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -358,13 +358,11 @@ static int readwrite(int fd, void* buf, int count, bool write) if (write) { memcpy( file->cache + offs, buf, headbytes ); if (offs+headbytes == SECTOR_SIZE) { - int rc = fat_readwrite(&(file->fatfile), 1, - file->cache, true ); + int rc = flush_cache(fd); if ( rc < 0 ) { errno = EIO; return -2; } - file->dirty = false; file->cacheoffset = -1; } else -- cgit v1.2.3