diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-02-19 10:01:26 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-02-19 10:01:26 -0600 |
commit | 9277eac1a8e6fb401e77e0802cb1d38a37f7530c (patch) | |
tree | 952c0fa6988492ce18b157a608a5656adb35e792 /apps/nshlib | |
parent | a056eba87db4299725e9c64a9869735a1400c1be (diff) | |
download | nuttx-9277eac1a8e6fb401e77e0802cb1d38a37f7530c.tar.gz nuttx-9277eac1a8e6fb401e77e0802cb1d38a37f7530c.tar.bz2 nuttx-9277eac1a8e6fb401e77e0802cb1d38a37f7530c.zip |
rmdir now may be used to remove empty nodes from the pseudo-filesystem
Diffstat (limited to 'apps/nshlib')
-rw-r--r-- | apps/nshlib/nsh.h | 6 | ||||
-rw-r--r-- | apps/nshlib/nsh_command.c | 3 | ||||
-rw-r--r-- | apps/nshlib/nsh_fscmds.c | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h index 2ea49706d..78a5ea538 100644 --- a/apps/nshlib/nsh.h +++ b/apps/nshlib/nsh.h @@ -717,6 +717,9 @@ void nsh_usbtrace(void); # ifndef CONFIG_NSH_DISABLE_LS int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif +# ifndef CONFIG_NSH_DISABLE_RMDIR + int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); +# endif # if defined(CONFIG_SYSLOG) && defined(CONFIG_RAMLOG_SYSLOG) && !defined(CONFIG_NSH_DISABLE_DMESG) int cmd_dmesg(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif @@ -755,9 +758,6 @@ void nsh_usbtrace(void); # ifndef CONFIG_NSH_DISABLE_RM int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); # endif -# ifndef CONFIG_NSH_DISABLE_RMDIR - int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv); -# endif # endif /* CONFIG_FS_WRITABLE */ # endif /* CONFIG_FS_READABLE */ # ifdef CONFIG_FS_FAT diff --git a/apps/nshlib/nsh_command.c b/apps/nshlib/nsh_command.c index ea028d463..996383694 100644 --- a/apps/nshlib/nsh_command.c +++ b/apps/nshlib/nsh_command.c @@ -344,6 +344,9 @@ static const struct cmdmap_s g_cmdmap[] = # ifndef CONFIG_NSH_DISABLE_RM { "rm", cmd_rm, 2, 2, "<file-path>" }, # endif +# endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 # ifndef CONFIG_NSH_DISABLE_RMDIR { "rmdir", cmd_rmdir, 2, 2, "<dir-path>" }, # endif diff --git a/apps/nshlib/nsh_fscmds.c b/apps/nshlib/nsh_fscmds.c index 0ece652f3..fd4cac222 100644 --- a/apps/nshlib/nsh_fscmds.c +++ b/apps/nshlib/nsh_fscmds.c @@ -1369,7 +1369,7 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) * Name: cmd_rmdir ****************************************************************************/ -#if !defined(CONFIG_DISABLE_MOUNTPOINT) && CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_FS_WRITABLE) +#if CONFIG_NFILE_DESCRIPTORS > 0 #ifndef CONFIG_NSH_DISABLE_RMDIR int cmd_rmdir(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { |