From 5dd78cfbf81d2f313c06af10cc82984dc6af28b6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 28 Mar 2011 17:43:34 +0000 Subject: Fix an error in opendir() when a mountpoint is in the root directory. git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3432 42af7a65-404d-4744-a932-0658087f49c3 --- apps/namedapp/binfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps/namedapp') diff --git a/apps/namedapp/binfs.c b/apps/namedapp/binfs.c index 9d2e4a7ee..a9aed59d6 100644 --- a/apps/namedapp/binfs.c +++ b/apps/namedapp/binfs.c @@ -310,7 +310,7 @@ static int binfs_opendir(struct inode *mountpt, const char *relpath, struct binfs_state_s *bm; int ret; - fvdbg("relpath: '%s'\n", relpath); + fvdbg("relpath: \"%s\"\n", relpath ? relpath : "NULL"); /* Sanity checks */ @@ -352,8 +352,6 @@ static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) unsigned int index; int ret; - fvdbg("Entry\n"); - /* Sanity checks */ DEBUGASSERT(mountpt != NULL && mountpt->i_private != NULL); @@ -372,13 +370,14 @@ static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir) * special error -ENOENT */ - fdbg("End of directory\n"); + fvdbg("Entry %d: End of directory\n", index); ret = -ENOENT; } else { /* Save the filename and file type */ + fvdbg("Entry %d: \"%s\"\n", index, namedapps[index].name); dir->fd_dir.d_type = DTYPE_FILE; strncpy(dir->fd_dir.d_name, namedapps[index].name, NAME_MAX+1); -- cgit v1.2.3