diff --git a/ChangeLog.txt b/ChangeLog.txt index e0e769916..018dd72ff 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -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). diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 2ea49706d..78a5ea538 100644 --- a/nshlib/nsh.h +++ b/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/nshlib/nsh_command.c b/nshlib/nsh_command.c index ea028d463..996383694 100644 --- a/nshlib/nsh_command.c +++ b/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, "" }, # endif +# endif + +#if CONFIG_NFILE_DESCRIPTORS > 0 # ifndef CONFIG_NSH_DISABLE_RMDIR { "rmdir", cmd_rmdir, 2, 2, "" }, # endif diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index 0ece652f3..fd4cac222 100644 --- a/nshlib/nsh_fscmds.c +++ b/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) {