提交 e9ad6b71 编写于 作者: C chenjing

fix: 增加表头,内容以制表符分栏。

close #I3W2M9
Signed-off-by: Nchenjing <chenjing139@huawei.com>
Change-Id: If8ba7047e2914a3104182bf017f437c2ae962625
上级 e5a3ee6f
...@@ -42,44 +42,38 @@ static int ShowType(const char *mountPoint, struct statfs *statBuf, void *arg) ...@@ -42,44 +42,38 @@ static int ShowType(const char *mountPoint, struct statfs *statBuf, void *arg)
{ {
struct SeqBuf *seqBuf = (struct SeqBuf *)arg; struct SeqBuf *seqBuf = (struct SeqBuf *)arg;
char *type = NULL; char *type = NULL;
char *name = NULL;
switch (statBuf->f_type) { switch (statBuf->f_type) {
case PROCFS_MAGIC: case PROCFS_MAGIC:
type = "proc"; type = "proc";
name = "proc";
break; break;
case JFFS2_SUPER_MAGIC: case JFFS2_SUPER_MAGIC:
type = "jffs2"; type = "jffs2";
name = "jffs2";
break; break;
case NFS_SUPER_MAGIC: case NFS_SUPER_MAGIC:
type = "nfs"; type = "nfs";
name = "nfs";
break; break;
case TMPFS_MAGIC: case TMPFS_MAGIC:
type = "tmpfs"; type = "tmpfs";
name = "tmpfs";
break; break;
case MSDOS_SUPER_MAGIC: case MSDOS_SUPER_MAGIC:
type = "vfat"; type = "vfat";
name = "fat";
break; break;
case ZPFS_MAGIC: case ZPFS_MAGIC:
type = "zpfs"; type = "zpfs";
name = "zpfs";
break; break;
default: default:
return 0; return 0;
} }
(void)LosBufPrintf(seqBuf, "%s %s %s\n", name, mountPoint, type); (void)LosBufPrintf(seqBuf, "%s\t%s\n", type, mountPoint);
return 0; return 0;
} }
static int MountsProcFill(struct SeqBuf *m, void *v) static int MountsProcFill(struct SeqBuf *m, void *v)
{ {
(void)LosBufPrintf(m, "%s\t%s\n", "Type", "MountPoint");
foreach_mountpoint_t handler = ShowType; foreach_mountpoint_t handler = ShowType;
(void)foreach_mountpoint(handler, (void *)m); (void)foreach_mountpoint(handler, (void *)m);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册