diff options
author | Narayan Kamath <narayan@google.com> | 2015-01-16 16:26:54 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2015-01-19 14:17:49 +0000 |
commit | 6ac7e67168d89f85f622dd168a05ddfc2644f6d4 (patch) | |
tree | e896b2ee140c8a63752be8d6c611d5c70b5d00ef /core/java/com | |
parent | 4ac5775d63791ae3635882a3b49f5ebc253262bb (diff) | |
download | frameworks_base-6ac7e67168d89f85f622dd168a05ddfc2644f6d4.zip frameworks_base-6ac7e67168d89f85f622dd168a05ddfc2644f6d4.tar.gz frameworks_base-6ac7e67168d89f85f622dd168a05ddfc2644f6d4.tar.bz2 |
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
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/os/ZygoteConnection.java | 2 |
1 files changed, 2 insertions, 0 deletions
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); } /** |