summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-11-13 15:59:14 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-11-13 15:59:14 -0600
commitc941f3e4f6ac25434d4f486b1b0b5205343be116 (patch)
tree89094fc2db0447e93c3a80283665d2c28fa81363 /apps
parent7fa9515651aeaae9415d5a1ed0dccab347cf58e1 (diff)
downloadnuttx-c941f3e4f6ac25434d4f486b1b0b5205343be116.tar.gz
nuttx-c941f3e4f6ac25434d4f486b1b0b5205343be116.tar.bz2
nuttx-c941f3e4f6ac25434d4f486b1b0b5205343be116.zip
fs/procfs: Add a tiny, primitive procfs file system. Might get more interesting in the future
Diffstat (limited to 'apps')
-rw-r--r--apps/nshlib/nsh_fscmds.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c
index 48dad2082..3337dd592 100644
--- a/apps/nshlib/nsh_fscmds.c
+++ b/apps/nshlib/nsh_fscmds.c
@@ -957,7 +957,12 @@ int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* See if it is a single file */
- if (stat(fullpath, &st) == 0 && !S_ISDIR(st.st_mode))
+ if (stat(fullpath, &st) < 0)
+ {
+ nsh_output(vtbl, g_fmtcmdfailed, argv[0], "stat", NSH_ERRNO);
+ ret = ERROR;
+ }
+ else if (!S_ISDIR(st.st_mode))
{
/* Pass a null dirent to ls_handler to signify that this is a single
* file