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

Commit 9d66fa04 authored by Torne (Richard Coles)'s avatar Torne (Richard Coles)
Browse files

Don't try to create a process group when not root.

The WebView zygote doesn't run with uid 0 and so can't create a process
group, since the directory in the cgroupfs is only writable by root.
Skip this when the zygote isn't running with uid 0 to avoid the error
being printed, as this causes misattribution of bugs.

Bug: 62435375
Test: use WebView, check log
Change-Id: I50164bba5ac7587933d58ca0595336ba4fe33728
parent 89b18289
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -666,7 +666,9 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra
      }
    }

    if (!is_system_server) {
    // If this zygote isn't root, it won't be able to create a process group,
    // since the directory is owned by root.
    if (!is_system_server && getuid() == 0) {
        int rc = createProcessGroup(uid, getpid());
        if (rc != 0) {
            if (rc == -EROFS) {