summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-03-12 15:15:46 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-03-12 15:15:46 +0000
commit3ca8d3589e9bdb260984f90d7e2109a27ca8449c (patch)
treebb92f8730983d6bbeab8f5a9e648c15030f9004d /firmware
parent188be8ec579e257a3d2905ff974c3571a02770d0 (diff)
downloadrockbox-3ca8d3589e9bdb260984f90d7e2109a27ca8449c.tar.gz
rockbox-3ca8d3589e9bdb260984f90d7e2109a27ca8449c.zip
flush_cache() failure should still return error.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3433 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 3755560998..83c8e045fa 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -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 (count && file->dirty) {
+ if (nread && file->dirty) {
rc = flush_cache(fd);
if (rc < 0)
- return nread ? nread : rc * 10 - 3;
+ return rc * 10 - 3;
}
/* read whole sectors right into the supplied buffer */