rmdir now may be used to remove empty nodes from the pseudo-filesystem

This commit is contained in:
Gregory Nutt 2014-02-19 10:01:26 -06:00
parent 39c981668d
commit b70ce5f634
4 changed files with 10 additions and 5 deletions

View File

@ -825,4 +825,6 @@
(2014-2-10).
* apps/examples/nximage/Kconfig and apps/examples/uip/Kconfig: Incomplete
Kconfig files fleshed out by Alan Carvalho de Assis (2014-2-18).
* apps/nshilib: rmdir can now be used in the pseudo-filesystem. Hence,
the command needs to be available even if there are no write-able
filesystem enabled (2014-2-19).

View File

@ -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

View File

@ -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

View File

@ -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)
{