diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-11-17 12:30:04 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-11-17 12:30:04 -0600 |
commit | 852901048852cfd9ab1c5abb5ec79188fa1fafe9 (patch) | |
tree | 020aa60a2789f46e7c20b78280c40cea782117a5 | |
parent | dd05b6c29749b2cc98f045cb057a1836a93cf4ca (diff) | |
download | nuttx-852901048852cfd9ab1c5abb5ec79188fa1fafe9.tar.gz nuttx-852901048852cfd9ab1c5abb5ec79188fa1fafe9.tar.bz2 nuttx-852901048852cfd9ab1c5abb5ec79188fa1fafe9.zip |
NSH mount count updated from Ken Pettit
-rw-r--r-- | apps/ChangeLog.txt | 4 | ||||
-rw-r--r-- | apps/nshlib/nsh_mntcmds.c | 19 |
2 files changed, 20 insertions, 3 deletions
diff --git a/apps/ChangeLog.txt b/apps/ChangeLog.txt index 1dd37754f..87d829b39 100644 --- a/apps/ChangeLog.txt +++ b/apps/ChangeLog.txt @@ -734,4 +734,6 @@ NxPlayer threads now have names assigned via pthread_setname_np(). From Ken Pettit (2013-11-10). * apps/examples/i2schar: The beginning of an I2C test based on the I2C - character driver (2013-11-10).
\ No newline at end of file + character driver (2013-11-10). + * apps/nshlib/nsh_mntcmds.c: Mount command updates from Ken Pettit + (2013-11-17). diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c index 3933ed909..b8a97477b 100644 --- a/apps/nshlib/nsh_mntcmds.c +++ b/apps/nshlib/nsh_mntcmds.c @@ -130,6 +130,12 @@ static const char* get_fstype(FAR struct statfs *statbuf) break; #endif +#ifdef CONFIG_FS_PROCFS + case PROCFS_MAGIC: + fstype = "procfs"; + break; +#endif + default: fstype = "Unrecognized"; break; @@ -215,15 +221,20 @@ static int df_man_readable_handler(FAR const char *mountpoint, } usedlabel = labels[which]; +#ifndef CONFIG_NUTTX_KERNEL nsh_output(vtbl, "%-10s %6ld%c %8ld%c %8ld%c %s\n", get_fstype(statbuf), size, sizelabel, used, usedlabel, free, freelabel, mountpoint); +#else + nsh_output(vtbl, "%6ld%c %8ld%c %8ld%c %s\n", size, sizelabel, used, + usedlabel, free, freelabel, mountpoint); +#endif return OK; } #endif /* CONFIG_NSH_CMDOPT_DF_H */ -#endif /* CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && +#endif /* CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) && !defined(CONFIG_NSH_DISABLE_DF) */ /**************************************************************************** @@ -280,7 +291,11 @@ int cmd_df(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) #ifdef CONFIG_NSH_CMDOPT_DF_H if (argc > 1 && strcmp(argv[1], "-h") == 0) { +#ifndef CONFIG_NUTTX_KERNEL nsh_output(vtbl, "Filesystem Size Used Available Mounted on\n"); +#else + nsh_output(vtbl, "Size Used Available Mounted on\n"); +#endif return foreach_mountpoint(df_man_readable_handler, (FAR void *)vtbl); } else @@ -369,7 +384,7 @@ int cmd_mount(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) source = NULL; target = argv[optind]; optind++; - + if (optind < argc) { source = target; |