提交 e901790b 编写于 作者: O openharmony_ci 提交者: Gitee

!48 【轻量级 PR】:代码中mount nfs问题修复

Merge pull request !48 from zhangfanfan2/N/A
...@@ -500,6 +500,26 @@ out: ...@@ -500,6 +500,26 @@ out:
return 0; return 0;
} }
#ifdef LOSCFG_FS_NFS
static int NfsMountRef(const char *serverIpAndPath, const char *mountPath,
unsigned int uid, unsigned int gid) __attribute__((weakref("nfs_mount")));
static int NfsMount(const char *serverIpAndPath, const char *mountPath,
unsigned int uid, unsigned int gid)
{
int ret;
if ((serverIpAndPath == NULL) || (mountPath == NULL)) {
return -EINVAL;
}
ret = NfsMountRef(serverIpAndPath, mountPath, uid, gid);
if (ret < 0) {
ret = -get_errno();
}
return ret;
}
#endif
int SysMount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, int SysMount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags,
const void *data) const void *data)
{ {
...@@ -534,6 +554,12 @@ int SysMount(const char *source, const char *target, const char *filesystemtype, ...@@ -534,6 +554,12 @@ int SysMount(const char *source, const char *target, const char *filesystemtype,
goto OUT; goto OUT;
} }
} }
#ifdef LOSCFG_FS_NFS
if (strcmp(fstypeRet, "nfs") == 0) {
ret = NfsMount(sourceRet, targetRet, 0, 0);
goto OUT;
}
#endif
} }
ret = mount(sourceRet, targetRet, (filesystemtype ? fstypeRet : NULL), mountflags, data); ret = mount(sourceRet, targetRet, (filesystemtype ? fstypeRet : NULL), mountflags, data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册