Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9afc35a3 authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Automerger Merge Worker
Browse files

Merge "Treat failure to create a process group as fatal" am: 75eb2481 am:...

Merge "Treat failure to create a process group as fatal" am: 75eb2481 am: bf58a328 am: 2bc65487

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2053131



Change-Id: I779758482927e1ec2b86dfe371471ee62d84feac
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 006aca11 2bc65487
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1599,10 +1599,11 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids,
    // since the directory is owned by root.
    if (!is_system_server && getuid() == 0) {
        const int rc = createProcessGroup(uid, getpid());
        if (rc == -EROFS) {
            ALOGW("createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?");
        } else if (rc != 0) {
            ALOGE("createProcessGroup(%d, %d) failed: %s", uid, /* pid= */ 0, strerror(-rc));
        if (rc != 0) {
            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)));
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -2307,8 +2307,8 @@ public final class ProcessList {
            if (!regularZygote) {
                // webview and app zygote don't have the permission to create the nodes
                if (Process.createProcessGroup(uid, startResult.pid) < 0) {
                    Slog.e(ActivityManagerService.TAG, "Unable to create process group for "
                            + app.processName + " (" + startResult.pid + ")");
                    throw new AssertionError("Unable to create process group for " + app.processName
                            + " (" + startResult.pid + ")");
                }
            }