Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "Revert "Treat process group creation failure due to a dead pro…
Browse files Browse the repository at this point in the history
…cess as non-fatal"" into main
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Sep 11, 2023
2 parents fe3deb0 + ecef005 commit dfbc64d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions core/jni/com_android_internal_os_Zygote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1806,15 +1806,10 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids,
if (!is_system_server && getuid() == 0) {
const int rc = createProcessGroup(uid, getpid());
if (rc != 0) {
if (rc == -ESRCH) {
// If process is dead, treat this as a non-fatal error
ALOGE("createProcessGroup(%d, %d) failed: %s", uid, /* pid= */ 0, strerror(-rc));
} else {
fail_fn(rc == -EROFS ? CREATE_ERROR("createProcessGroup failed, kernel missing "
"CONFIG_CGROUP_CPUACCT?")
: CREATE_ERROR("createProcessGroup(%d, %d) failed: %s", uid,
/* pid= */ 0, strerror(-rc)));
}
fail_fn(rc == -EROFS ? CREATE_ERROR("createProcessGroup failed, kernel missing "
"CONFIG_CGROUP_CPUACCT?")
: CREATE_ERROR("createProcessGroup(%d, %d) failed: %s", uid,
/* pid= */ 0, strerror(-rc)));
}
}

Expand Down

0 comments on commit dfbc64d

Please sign in to comment.