diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-26 16:37:37 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-05-26 16:37:37 +0000 |
commit | f93e30156c033d77182a052549a5e355a5d0a5a0 (patch) | |
tree | 9d0b407a1d5a2b105ea82ff905e9d640f0573ed5 /nuttx/fs/fs_opendir.c | |
parent | 2a3e5f6cd969f93fbb56d7ba2b63d7d8da11e756 (diff) | |
download | px4-nuttx-f93e30156c033d77182a052549a5e355a5d0a5a0.tar.gz px4-nuttx-f93e30156c033d77182a052549a5e355a5d0a5a0.tar.bz2 px4-nuttx-f93e30156c033d77182a052549a5e355a5d0a5a0.zip |
Add readdir() on mountpoints
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@251 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/fs_opendir.c')
-rw-r--r-- | nuttx/fs/fs_opendir.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/nuttx/fs/fs_opendir.c b/nuttx/fs/fs_opendir.c index 24462d53b..0b5a8969f 100644 --- a/nuttx/fs/fs_opendir.c +++ b/nuttx/fs/fs_opendir.c @@ -126,17 +126,6 @@ static inline FAR struct inode *fs_finddirnode(const char *path, const char **re } /************************************************************ - * Name: fs_openmountptdir - ************************************************************/ - -static inline int fs_openmountptdir(struct inode *inode, const char *relpath, - struct internal_dir_s *dir) -{ -#warning "Mountpoint support not implemented" - return -ENOSYS; -} - -/************************************************************ * Public Functions ************************************************************/ @@ -215,9 +204,19 @@ FAR DIR *opendir(const char *path) if (INODE_IS_MOUNTPT(inode)) { - /* The node is a file system mointpoint */ + /* The node is a file system mointpoint. Verify that the mountpoint + * supports the opendir() method + */ + + if (!inode->u.i_mops || !inode->u.i_mops->opendir) + { + ret = ENOSYS; + goto errout_with_direntry; + } + + /* Perform the opendir() operation */ - ret = fs_openmountptdir(inode, relpath, dir); + ret = inode->u.i_mops->opendir(inode, relpath, dir); if (ret < 0) { ret = -ret; |