forked from len0rd/rockbox
Revert "readdir_r use in tagcache.check_dir, ft_load"
This reverts commit 0c737d3b2e.
Reason for revert: Not really a concern as open_stream returns an independent buffer since g#566
Change-Id: Idbd2f4a7cc2ea6362b7714629469eeb7b3d19b3b
This commit is contained in:
parent
0c737d3b2e
commit
efcea66280
7 changed files with 24 additions and 129 deletions
|
|
@ -704,41 +704,6 @@ struct sim_dirent * sim_readdir(DIR *dirp)
|
|||
return entry;
|
||||
}
|
||||
|
||||
/* read a directory (reentrant) */
|
||||
int sim_readdir_r(DIR *dirp, struct sim_dirent *entry, struct sim_dirent **result)
|
||||
{
|
||||
if (!result)
|
||||
FILE_ERROR_RETURN(EFAULT, -2);
|
||||
|
||||
*result = NULL;
|
||||
|
||||
if (!entry)
|
||||
FILE_ERROR_RETURN(EFAULT, -3);
|
||||
|
||||
struct dirstr_desc *dirstr = get_dirstr(dirp);
|
||||
if (!dirstr)
|
||||
FILE_ERROR_RETURN(ERRNO, -1);
|
||||
|
||||
entry->info.osdirent = NULL;
|
||||
|
||||
if (readdir_volume(dirstr, entry))
|
||||
{
|
||||
*result = entry;
|
||||
return 0;
|
||||
}
|
||||
OS_DIRENT_T *osdirent = os_readdir(dirstr->osdirp);
|
||||
if (!osdirent)
|
||||
FILE_ERROR_RETURN(ERRNO, -4);
|
||||
|
||||
size_t size = sizeof (entry->d_name);
|
||||
if (strlcpy_from_os(entry->d_name, osdirent->d_name, size) >= size)
|
||||
FILE_ERROR_RETURN(ENAMETOOLONG, -5);
|
||||
|
||||
entry->info.osdirent = osdirent;
|
||||
*result = entry;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sim_mkdir(const char *path)
|
||||
{
|
||||
char ospath[SIM_TMPBUF_MAX_PATH];
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ struct dirinfo_native
|
|||
#ifndef DIRFUNCTIONS_DECLARED
|
||||
DIR * sim_opendir(const char *dirname);
|
||||
struct sim_dirent * sim_readdir(DIR *dirp);
|
||||
int sim_readdir_r(DIR *dirp, struct sim_dirent* entry, struct sim_dirent **result);
|
||||
int sim_closedir(DIR *dirp);
|
||||
int sim_mkdir(const char *path);
|
||||
int sim_rmdir(const char *path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue