提交 7dd1a430 编写于 作者: O openharmony_ci 提交者: Gitee

!49 修改/proc/mounts显示格式

Merge pull request !49 from JING/mount
......@@ -77,7 +77,7 @@ int foreach_mountpoint(foreach_mountpoint_t handler, void *arg)
ret = mnt->ops->Statfs(mnt, &statBuf);
if (ret == OK)
{
(void)handler(mnt->pathName, &statBuf, arg);
(void)handler(mnt->devName, mnt->pathName, &statBuf, arg);
}
}
}
......
......@@ -281,10 +281,22 @@ int mount(const char *source, const char *target,
mnt->vnodeCovered->flag |= VNODE_FLAG_MOUNT_NEW;
mnt->ops = mops;
mnt->mountFlags = mountflags;
ret = strcpy_s(mnt->pathName, PATH_MAX, target);
if (ret != EOK)
if (target && (strlen(target) != 0))
{
PRINT_ERR("Failed to copy mount point pathname, errno %d\n", ret);
ret = strcpy_s(mnt->pathName, PATH_MAX, target);
if (ret != EOK)
{
PRINT_ERR("Failed to copy mount point pathname, errno %d\n", ret);
}
}
if (source && (strlen(source) != 0))
{
ret = strcpy_s(mnt->devName, PATH_MAX, source);
if (ret != EOK)
{
PRINT_ERR("Failed to copy dev name, errno %d\n", ret);
}
}
//* We have it, now populate it with driver specific information. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册