summaryrefslogtreecommitdiffstats
path: root/firmware/common/file.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-01-18 04:39:35 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-02-10 05:05:23 -0500
commit7373cf518f4d4c47f49693690c2ab8ec29bb8510 (patch)
tree0a3c025749be24561e952078e83c5f2e8b838900 /firmware/common/file.c
parentabd75a17d18c0779b59f64a612f9226b62af5823 (diff)
downloadrockbox-7373cf518f4d4c47f49693690c2ab8ec29bb8510.tar.gz
rockbox-7373cf518f4d4c47f49693690c2ab8ec29bb8510.zip
Restore dircache hookup in the database ramcache.
Do a few other changes to dircache and file code flags to accomodate its demands. Change-Id: I4742a54e8cfbe4d8b9cffb75faaf920dd907cf8a
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r--firmware/common/file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 1f93824dc8..028bdbe9f0 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -354,6 +354,10 @@ static int open_internal_inner2(const char *path,
int rc;
struct path_component_info compinfo;
+
+ if (callflags & FF_CREAT)
+ callflags |= FF_PARENTINFO;
+
rc = open_stream_internal(path, callflags, &file->stream, &compinfo);
if (rc < 0)
{
@@ -989,7 +993,8 @@ int rename(const char *old, const char *new)
file_internal_lock_WRITER();
/* open 'old'; it must exist */
- open1rc = open_stream_internal(old, FF_ANYTYPE, &oldstr, &oldinfo);
+ open1rc = open_stream_internal(old, FF_ANYTYPE | FF_PARENTINFO, &oldstr,
+ &oldinfo);
if (open1rc <= 0)
{
DEBUGF("Failed opening old: %d\n", open1rc);
@@ -1014,7 +1019,8 @@ int rename(const char *old, const char *new)
newinfo.prefixp = oldstr.infop;
}
- open2rc = open_stream_internal(new, callflags, &newstr, &newinfo);
+ open2rc = open_stream_internal(new, callflags | FF_PARENTINFO, &newstr,
+ &newinfo);
if (open2rc < 0)
{
DEBUGF("Failed opening new file: %d\n", open2rc);