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:
Miika Pekkarinen 2005-10-09 07:32:23 +00:00
parent 104d38cd8b
commit 20bc58dc9a

View file

@ -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;