From 6ac7e67168d89f85f622dd168a05ddfc2644f6d4 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Fri, 16 Jan 2015 16:26:54 +0000 Subject: Fix handling of wrapped processes [part 1]. Change 3fe595108f47fffd 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 --- core/java/com/android/internal/os/ZygoteConnection.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/java/com') diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java index c03938a..28cd799 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java @@ -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); } /** -- cgit v1.1