HOSTFS: Fix some errors in first cut at repartitioning

This commit is contained in:
Gregory Nutt 2016-07-17 16:31:14 -06:00
parent 2b28a1f3e5
commit 006f4a5818
3 changed files with 11 additions and 10 deletions

View File

@ -200,7 +200,6 @@ int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
/* Call the host's readdir routine */ /* Call the host's readdir routine */
ent = readdir(dirp); ent = readdir(dirp);
if (ent != NULL) if (ent != NULL)
{ {
/* Copy the entry name */ /* Copy the entry name */
@ -226,10 +225,7 @@ int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
{ {
entry->d_type = NUTTX_DTYPE_DIRECTORY; entry->d_type = NUTTX_DTYPE_DIRECTORY;
} }
}
if (ent)
{
return 0; return 0;
} }

View File

@ -734,7 +734,6 @@ static int hostfs_readdir(FAR struct inode *mountpt,
FAR struct fs_dirent_s *dir) FAR struct fs_dirent_s *dir)
{ {
FAR struct hostfs_mountpt_s *fs; FAR struct hostfs_mountpt_s *fs;
struct dirent entry;
int ret; int ret;
/* Sanity checks */ /* Sanity checks */
@ -751,7 +750,7 @@ static int hostfs_readdir(FAR struct inode *mountpt,
/* Call the host OS's readdir function */ /* 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); hostfs_semgive(fs);
return ret; return ret;

View File

@ -46,6 +46,8 @@
# include <sys/statfs.h> # include <sys/statfs.h>
# include <dirent.h> # include <dirent.h>
# include <time.h> # include <time.h>
#else
# include <stdint.h>
#endif #endif
/**************************************************************************** /****************************************************************************
@ -84,6 +86,10 @@
#define NUTTX_O_RDWR (NUTTX_O_RDONLY | NUTTX_O_WRONLY) #define NUTTX_O_RDWR (NUTTX_O_RDONLY | NUTTX_O_WRONLY)
/* Should match definition in include/limits.h */
#define NUTTX_NAME_MAX 32
#endif /* __SIM__ */ #endif /* __SIM__ */
/**************************************************************************** /****************************************************************************
@ -109,7 +115,7 @@ typedef uint32_t nuttx_time_t;
struct nuttx_dirent_s struct nuttx_dirent_s
{ {
uint8_t d_type; /* type of file */ 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: */ /* These must exactly match the definition from include/sys/statfs.h: */