Do not try to read from dircache if directory was opened when cache was not
available. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7602 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
104d38cd8b
commit
20bc58dc9a
1 changed files with 5 additions and 4 deletions
|
@ -743,10 +743,8 @@ struct dircache_entry* readdir_cached(DIRCACHED* dir)
|
|||
if (!dir->busy)
|
||||
return NULL;
|
||||
|
||||
if (!dircache_initialized)
|
||||
if (dir->regulardir != NULL)
|
||||
{
|
||||
if (dir->regulardir == NULL)
|
||||
return NULL;
|
||||
regentry = readdir(dir->regulardir);
|
||||
if (regentry == NULL)
|
||||
return NULL;
|
||||
|
@ -789,8 +787,11 @@ struct dircache_entry* readdir_cached(DIRCACHED* dir)
|
|||
|
||||
int closedir_cached(DIRCACHED* dir)
|
||||
{
|
||||
if (!dir->busy)
|
||||
return -1;
|
||||
|
||||
dir->busy=false;
|
||||
if (!dircache_initialized && dir->regulardir != NULL)
|
||||
if (dir->regulardir != NULL)
|
||||
return closedir(dir->regulardir);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue