提交 b685aabe 编写于 作者: M Mupceet

init: fix bugs

Signed-off-by: NMupceet <laiguizhong@huawei.com>
上级 8534c414
......@@ -56,7 +56,6 @@ bool InitSandboxWithName(const char *name);
int PrepareSandbox(const char *name);
int EnterSandbox(const char *name);
void DestroySandbox(const char *name);
int CheckSupportSandbox(void);
void DumpSandboxByName(const char *name);
#ifdef __cplusplus
}
......
......@@ -23,7 +23,7 @@ extern "C" {
int GetNamespaceFd(const char *nsPath);
int UnshareNamespace(int nsType);
int SetNamespce(int nsFd, int nsType);
int SetNamespace(int nsFd, int nsType);
void InitDefaultNamespace(void);
int EnterDefaultNamespace(void);
void CloseDefaultNamespace(void);
......@@ -33,4 +33,5 @@ void CloseDefaultNamespace(void);
}
#endif
#endif
#endif
\ No newline at end of file
#endif
......@@ -602,7 +602,7 @@ int EnterSandbox(const char *name)
return -1;
}
if (sandbox->ns > 0) {
if (SetNamespce(sandbox->ns, CLONE_NEWNS) < 0) {
if (SetNamespace(sandbox->ns, CLONE_NEWNS) < 0) {
BEGET_LOGE("Failed to enter mount namespace for sandbox \' %s \', err=%d.", name, errno);
return -1;
}
......
......@@ -51,7 +51,7 @@ int UnshareNamespace(int nsType)
}
}
int SetNamespce(int nsFd, int nsType)
int SetNamespace(int nsFd, int nsType)
{
if (nsFd < 0) {
BEGET_LOGE("Failed get namespace fd");
......@@ -78,7 +78,7 @@ int EnterDefaultNamespace(void)
if (g_defaultNs < 0) {
return -1;
}
return SetNamespce(g_defaultNs, CLONE_NEWNS);
return SetNamespace(g_defaultNs, CLONE_NEWNS);
}
void CloseDefaultNamespace(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册