1
0
Fork 0
forked from len0rd/rockbox

flush_cache() failure should still return error.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3433 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2003-03-12 15:15:46 +00:00
parent 188be8ec57
commit 3ca8d3589e

View file

@ -406,10 +406,10 @@ static int readwrite(int fd, void* buf, int count, bool write)
} }
/* if buffer has been modified, write it back to disk */ /* if buffer has been modified, write it back to disk */
if (count && file->dirty) { if (nread && file->dirty) {
rc = flush_cache(fd); rc = flush_cache(fd);
if (rc < 0) if (rc < 0)
return nread ? nread : rc * 10 - 3; return rc * 10 - 3;
} }
/* read whole sectors right into the supplied buffer */ /* read whole sectors right into the supplied buffer */