summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-03-30 10:20:44 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-03-30 10:20:44 +0000
commit82f32e3f732fd8a18eae98486d483d66ccb9e12c (patch)
tree9959f3e44ad46d8e1a1a44716760e7e0f5805f4e
parente51490166568744e7838804d890e27cb15cee400 (diff)
downloadrockbox-82f32e3f732fd8a18eae98486d483d66ccb9e12c.zip
rockbox-82f32e3f732fd8a18eae98486d483d66ccb9e12c.tar.gz
rockbox-82f32e3f732fd8a18eae98486d483d66ccb9e12c.tar.bz2
rockbox-82f32e3f732fd8a18eae98486d483d66ccb9e12c.tar.xz
Do the dircache operation first to block properly when necessary.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9356 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/common/file.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index a0b4296..a83dc95 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -293,6 +293,9 @@ int remove(const char* name)
return fd * 10 - 1;
file = &openfiles[fd];
+#ifdef HAVE_DIRCACHE
+ dircache_remove(name);
+#endif
rc = fat_remove(&(file->fatfile));
if ( rc < 0 ) {
DEBUGF("Failed removing file: %d\n", rc);
@@ -301,9 +304,6 @@ int remove(const char* name)
}
file->size = 0;
-#ifdef HAVE_DIRCACHE
- dircache_remove(name);
-#endif
rc = close(fd);
if (rc<0)
@@ -364,6 +364,10 @@ int rename(const char* path, const char* newpath)
return - 5;
file = &openfiles[fd];
+#ifdef HAVE_DIRCACHE
+ dircache_rename(path, newpath);
+#endif
+
rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr,
file->size, file->attr);
#ifdef HAVE_MULTIVOLUME
@@ -379,10 +383,6 @@ int rename(const char* path, const char* newpath)
return rc * 10 - 7;
}
-#ifdef HAVE_DIRCACHE
- dircache_rename(path, newpath);
-#endif
-
rc = close(fd);
if (rc<0) {
errno = EIO;