Implement redirection of output from NSH builtin commands to a file in a mounted volume

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5521 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-15 21:01:37 +00:00
parent 90a72e97d3
commit fcb316906d
16 changed files with 1018 additions and 693 deletions
+3 -3
View File
@@ -399,7 +399,7 @@ static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
/* Have we reached the end of the directory */
index = dir->u.binfs.fb_index;
if (builtins[index].name == NULL)
if (g_builtins[index].name == NULL)
{
/* We signal the end of the directory by returning the
* special error -ENOENT
@@ -412,9 +412,9 @@ static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
{
/* Save the filename and file type */
fvdbg("Entry %d: \"%s\"\n", index, builtins[index].name);
fvdbg("Entry %d: \"%s\"\n", index, g_builtins[index].name);
dir->fd_dir.d_type = DTYPE_FILE;
strncpy(dir->fd_dir.d_name, builtins[index].name, NAME_MAX+1);
strncpy(dir->fd_dir.d_name, g_builtins[index].name, NAME_MAX+1);
/* The application list is terminated by an entry with a NULL name.
* Therefore, there is at least one more entry in the list.