NSH mount count updated from Ken Pettit
This commit is contained in:
parent
647703e649
commit
36345c7234
@ -735,3 +735,5 @@
|
|||||||
From Ken Pettit (2013-11-10).
|
From Ken Pettit (2013-11-10).
|
||||||
* apps/examples/i2schar: The beginning of an I2C test based on the I2C
|
* apps/examples/i2schar: The beginning of an I2C test based on the I2C
|
||||||
character driver (2013-11-10).
|
character driver (2013-11-10).
|
||||||
|
* apps/nshlib/nsh_mntcmds.c: Mount command updates from Ken Pettit
|
||||||
|
(2013-11-17).
|
||||||
|
@ -130,6 +130,12 @@ static const char* get_fstype(FAR struct statfs *statbuf)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_FS_PROCFS
|
||||||
|
case PROCFS_MAGIC:
|
||||||
|
fstype = "procfs";
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fstype = "Unrecognized";
|
fstype = "Unrecognized";
|
||||||
break;
|
break;
|
||||||
@ -215,9 +221,14 @@ static int df_man_readable_handler(FAR const char *mountpoint,
|
|||||||
}
|
}
|
||||||
usedlabel = labels[which];
|
usedlabel = labels[which];
|
||||||
|
|
||||||
|
#ifndef CONFIG_NUTTX_KERNEL
|
||||||
nsh_output(vtbl, "%-10s %6ld%c %8ld%c %8ld%c %s\n", get_fstype(statbuf),
|
nsh_output(vtbl, "%-10s %6ld%c %8ld%c %8ld%c %s\n", get_fstype(statbuf),
|
||||||
size, sizelabel, used, usedlabel, free, freelabel,
|
size, sizelabel, used, usedlabel, free, freelabel,
|
||||||
mountpoint);
|
mountpoint);
|
||||||
|
#else
|
||||||
|
nsh_output(vtbl, "%6ld%c %8ld%c %8ld%c %s\n", size, sizelabel, used,
|
||||||
|
usedlabel, free, freelabel, mountpoint);
|
||||||
|
#endif
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -280,7 +291,11 @@ int cmd_df(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
#ifdef CONFIG_NSH_CMDOPT_DF_H
|
#ifdef CONFIG_NSH_CMDOPT_DF_H
|
||||||
if (argc > 1 && strcmp(argv[1], "-h") == 0)
|
if (argc > 1 && strcmp(argv[1], "-h") == 0)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_NUTTX_KERNEL
|
||||||
nsh_output(vtbl, "Filesystem Size Used Available Mounted on\n");
|
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);
|
return foreach_mountpoint(df_man_readable_handler, (FAR void *)vtbl);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user