no need to unshare

This commit is contained in:
5ec1cff
2024-01-02 23:49:19 +08:00
parent cbd0f0f0c3
commit 711a3e98d0
3 changed files with 2 additions and 18 deletions

View File

@@ -566,22 +566,6 @@ static bool prepare_environment() {
}
return true;
});
int old_ns;
char wd[128];
if (getcwd(wd, sizeof(wd)) == nullptr) {
PLOGE("get cwd");
return false;
}
if (!switch_mnt_ns(1, &old_ns)) return false;
if (chdir(wd) == -1) {
PLOGE("chdir %s", wd);
return false;
}
if (!switch_mnt_ns(0, &old_ns)) return false;
if (chdir(wd) == -1) {
PLOGE("chdir %s", wd);
return false;
}
updateStatus();
return true;
}