forked from len0rd/rockbox
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
This commit is contained in:
parent
e514901665
commit
82f32e3f73
1 changed files with 7 additions and 7 deletions
|
@ -293,6 +293,9 @@ int remove(const char* name)
|
||||||
return fd * 10 - 1;
|
return fd * 10 - 1;
|
||||||
|
|
||||||
file = &openfiles[fd];
|
file = &openfiles[fd];
|
||||||
|
#ifdef HAVE_DIRCACHE
|
||||||
|
dircache_remove(name);
|
||||||
|
#endif
|
||||||
rc = fat_remove(&(file->fatfile));
|
rc = fat_remove(&(file->fatfile));
|
||||||
if ( rc < 0 ) {
|
if ( rc < 0 ) {
|
||||||
DEBUGF("Failed removing file: %d\n", rc);
|
DEBUGF("Failed removing file: %d\n", rc);
|
||||||
|
@ -301,9 +304,6 @@ int remove(const char* name)
|
||||||
}
|
}
|
||||||
|
|
||||||
file->size = 0;
|
file->size = 0;
|
||||||
#ifdef HAVE_DIRCACHE
|
|
||||||
dircache_remove(name);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rc = close(fd);
|
rc = close(fd);
|
||||||
if (rc<0)
|
if (rc<0)
|
||||||
|
@ -364,6 +364,10 @@ int rename(const char* path, const char* newpath)
|
||||||
return - 5;
|
return - 5;
|
||||||
|
|
||||||
file = &openfiles[fd];
|
file = &openfiles[fd];
|
||||||
|
#ifdef HAVE_DIRCACHE
|
||||||
|
dircache_rename(path, newpath);
|
||||||
|
#endif
|
||||||
|
|
||||||
rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr,
|
rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr,
|
||||||
file->size, file->attr);
|
file->size, file->attr);
|
||||||
#ifdef HAVE_MULTIVOLUME
|
#ifdef HAVE_MULTIVOLUME
|
||||||
|
@ -379,10 +383,6 @@ int rename(const char* path, const char* newpath)
|
||||||
return rc * 10 - 7;
|
return rc * 10 - 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DIRCACHE
|
|
||||||
dircache_rename(path, newpath);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rc = close(fd);
|
rc = close(fd);
|
||||||
if (rc<0) {
|
if (rc<0) {
|
||||||
errno = EIO;
|
errno = EIO;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue