summaryrefslogtreecommitdiff
path: root/firmware/common/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/file.c')
-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 a0b4296495..a83dc9548a 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -293,6 +293,9 @@ int remove(const char* name)
293 return fd * 10 - 1; 293 return fd * 10 - 1;
294 294
295 file = &openfiles[fd]; 295 file = &openfiles[fd];
296#ifdef HAVE_DIRCACHE
297 dircache_remove(name);
298#endif
296 rc = fat_remove(&(file->fatfile)); 299 rc = fat_remove(&(file->fatfile));
297 if ( rc < 0 ) { 300 if ( rc < 0 ) {
298 DEBUGF("Failed removing file: %d\n", rc); 301 DEBUGF("Failed removing file: %d\n", rc);
@@ -301,9 +304,6 @@ int remove(const char* name)
301 } 304 }
302 305
303 file->size = 0; 306 file->size = 0;
304#ifdef HAVE_DIRCACHE
305 dircache_remove(name);
306#endif
307 307
308 rc = close(fd); 308 rc = close(fd);
309 if (rc<0) 309 if (rc<0)
@@ -364,6 +364,10 @@ int rename(const char* path, const char* newpath)
364 return - 5; 364 return - 5;
365 365
366 file = &openfiles[fd]; 366 file = &openfiles[fd];
367#ifdef HAVE_DIRCACHE
368 dircache_rename(path, newpath);
369#endif
370
367 rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr, 371 rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr,
368 file->size, file->attr); 372 file->size, file->attr);
369#ifdef HAVE_MULTIVOLUME 373#ifdef HAVE_MULTIVOLUME
@@ -379,10 +383,6 @@ int rename(const char* path, const char* newpath)
379 return rc * 10 - 7; 383 return rc * 10 - 7;
380 } 384 }
381 385
382#ifdef HAVE_DIRCACHE
383 dircache_rename(path, newpath);
384#endif
385
386 rc = close(fd); 386 rc = close(fd);
387 if (rc<0) { 387 if (rc<0) {
388 errno = EIO; 388 errno = EIO;