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

Commit 6ac7e671 authored by Narayan Kamath's avatar Narayan Kamath
Browse files

Fix handling of wrapped processes [part 1].

Change 3fe59510 changed our pipe creation to CLOEXEC,
which doesn't work so well for wrapper processes that call exec.

Sending down the PID pre-exec won't work so well because wrappers
are arbitrary and might fork themselves before finally starting
the child application process.

Change-Id: I065f0f2150dc1ff04d2b2e8b25f06b4c754809b9
parent 4ac5775d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.os;

import static android.system.OsConstants.F_SETFD;
import static android.system.OsConstants.O_CLOEXEC;
import static android.system.OsConstants.STDERR_FILENO;
import static android.system.OsConstants.STDIN_FILENO;
@@ -194,6 +195,7 @@ class ZygoteConnection {
                FileDescriptor[] pipeFds = Os.pipe2(O_CLOEXEC);
                childPipeFd = pipeFds[1];
                serverPipeFd = pipeFds[0];
                Os.fcntlInt(childPipeFd, F_SETFD, 0);
            }

            /**