Zygote: make libprocessgroup failures non-fatal

createProcessGroup can fail if the kernel does not support the
cpuacct cgroup.  Print a more useful error message, and don't
runtime abort.

Bug: 16243791
Change-Id: Ibbf081bda58a99c83b8070f55d151905c706b378
This commit is contained in:
Colin Cross
2014-07-14 15:07:04 -07:00
parent 85cfec811e
commit 3089bed197

View File

@@ -439,8 +439,11 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra
if (!is_system_server) {
int rc = createProcessGroup(uid, getpid());
if (rc != 0) {
ALOGE("createProcessGroup(%d, %d) failed: %s", uid, pid, strerror(-rc));
RuntimeAbort(env);
if (rc == -EROFS) {
ALOGW("createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?");
} else {
ALOGE("createProcessGroup(%d, %d) failed: %s", uid, pid, strerror(-rc));
}
}
}