Use xwrap functions

This commit is contained in:
topjohnwu 2018-07-13 22:10:24 +08:00
parent 513d732934
commit 6ccc5f3788

4
su.c
View File

@ -235,12 +235,12 @@ int su_daemon_main(int argc, char **argv) {
LOGD("su: use namespace of pid=[%d]\n", su_ctx->pid); LOGD("su: use namespace of pid=[%d]\n", su_ctx->pid);
if (switch_mnt_ns(su_ctx->pid)) { if (switch_mnt_ns(su_ctx->pid)) {
LOGD("su: setns failed, fallback to isolated\n"); LOGD("su: setns failed, fallback to isolated\n");
unshare(CLONE_NEWNS); xunshare(CLONE_NEWNS);
} }
break; break;
case NAMESPACE_MODE_ISOLATE: case NAMESPACE_MODE_ISOLATE:
LOGD("su: use new isolated namespace\n"); LOGD("su: use new isolated namespace\n");
unshare(CLONE_NEWNS); xunshare(CLONE_NEWNS);
break; break;
} }