HOSTFS: Fix some errors in first cut at repartitioning
This commit is contained in:
parent
2b28a1f3e5
commit
006f4a5818
@ -195,12 +195,11 @@ void *host_opendir(const char *name)
|
||||
|
||||
int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
|
||||
{
|
||||
struct dirent *ent;
|
||||
struct dirent *ent;
|
||||
|
||||
/* Call the host's readdir routine */
|
||||
|
||||
ent = readdir(dirp);
|
||||
|
||||
if (ent != NULL)
|
||||
{
|
||||
/* Copy the entry name */
|
||||
@ -226,10 +225,7 @@ int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
|
||||
{
|
||||
entry->d_type = NUTTX_DTYPE_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
||||
if (ent)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -240,7 +236,7 @@ int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
void host_rewinddir(void* dirp)
|
||||
void host_rewinddir(void *dirp)
|
||||
{
|
||||
/* Just call the rewinddir routine */
|
||||
|
||||
@ -251,7 +247,7 @@ void host_rewinddir(void* dirp)
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
int host_closedir(void* dirp)
|
||||
int host_closedir(void *dirp)
|
||||
{
|
||||
return closedir(dirp);
|
||||
}
|
||||
|
@ -734,7 +734,6 @@ static int hostfs_readdir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir)
|
||||
{
|
||||
FAR struct hostfs_mountpt_s *fs;
|
||||
struct dirent entry;
|
||||
int ret;
|
||||
|
||||
/* Sanity checks */
|
||||
@ -751,7 +750,7 @@ static int hostfs_readdir(FAR struct inode *mountpt,
|
||||
|
||||
/* Call the host OS's readdir function */
|
||||
|
||||
ret = host_readdir(dir->u.hostfs.fs_dir, &entry);
|
||||
ret = host_readdir(dir->u.hostfs.fs_dir, &dir->fd_dir);
|
||||
|
||||
hostfs_semgive(fs);
|
||||
return ret;
|
||||
|
@ -46,6 +46,8 @@
|
||||
# include <sys/statfs.h>
|
||||
# include <dirent.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@ -84,6 +86,10 @@
|
||||
|
||||
#define NUTTX_O_RDWR (NUTTX_O_RDONLY | NUTTX_O_WRONLY)
|
||||
|
||||
/* Should match definition in include/limits.h */
|
||||
|
||||
#define NUTTX_NAME_MAX 32
|
||||
|
||||
#endif /* __SIM__ */
|
||||
|
||||
/****************************************************************************
|
||||
@ -109,7 +115,7 @@ typedef uint32_t nuttx_time_t;
|
||||
struct nuttx_dirent_s
|
||||
{
|
||||
uint8_t d_type; /* type of file */
|
||||
char d_name[NAME_MAX+1]; /* filename */
|
||||
char d_name[NUTTX_NAME_MAX+1]; /* filename */
|
||||
};
|
||||
|
||||
/* These must exactly match the definition from include/sys/statfs.h: */
|
||||
|
Loading…
Reference in New Issue
Block a user