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)
|
int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
|
||||||
{
|
{
|
||||||
struct dirent *ent;
|
struct dirent *ent;
|
||||||
|
|
||||||
/* 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +236,7 @@ int host_readdir(void* dirp, struct nuttx_dirent_s* entry)
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void host_rewinddir(void* dirp)
|
void host_rewinddir(void *dirp)
|
||||||
{
|
{
|
||||||
/* Just call the rewinddir routine */
|
/* Just call the rewinddir routine */
|
||||||
|
|
||||||
@ -251,7 +247,7 @@ void host_rewinddir(void* dirp)
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int host_closedir(void* dirp)
|
int host_closedir(void *dirp)
|
||||||
{
|
{
|
||||||
return closedir(dirp);
|
return closedir(dirp);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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: */
|
||||||
|
Loading…
Reference in New Issue
Block a user