summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/common/file.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 90fab6db99..f37fb0ae7f 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -340,10 +340,17 @@ int rename(const char* path, const char* newpath)
340 file = &openfiles[fd]; 340 file = &openfiles[fd];
341 rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr, 341 rc = fat_rename(&file->fatfile, &dir->fatdir, nameptr,
342 file->size, file->attr); 342 file->size, file->attr);
343#ifdef HAVE_MULTIVOLUME
344 if ( rc == -1) {
345 DEBUGF("Failed renaming file across volumnes: %d\n", rc);
346 errno = EXDEV;
347 return -6;
348 }
349#endif
343 if ( rc < 0 ) { 350 if ( rc < 0 ) {
344 DEBUGF("Failed renaming file: %d\n", rc); 351 DEBUGF("Failed renaming file: %d\n", rc);
345 errno = EIO; 352 errno = EIO;
346 return rc * 10 - 6; 353 return rc * 10 - 7;
347 } 354 }
348 355
349#ifdef HAVE_DIRCACHE 356#ifdef HAVE_DIRCACHE
@@ -353,13 +360,13 @@ int rename(const char* path, const char* newpath)
353 rc = close(fd); 360 rc = close(fd);
354 if (rc<0) { 361 if (rc<0) {
355 errno = EIO; 362 errno = EIO;
356 return rc * 10 - 7; 363 return rc * 10 - 8;
357 } 364 }
358 365
359 rc = closedir(dir); 366 rc = closedir(dir);
360 if (rc<0) { 367 if (rc<0) {
361 errno = EIO; 368 errno = EIO;
362 return rc * 10 - 8; 369 return rc * 10 - 9;
363 } 370 }
364 371
365 return 0; 372 return 0;