summaryrefslogtreecommitdiffstats
path: root/cmds/app_process/app_main.cpp
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-03-15 11:38:29 -0700
committerNick Kralevich <nnk@google.com>2013-03-15 11:59:03 -0700
commit1fe21bd1b6ca8b94c78fbf3666a1e8e0472355de (patch)
treed3fe55e4014a23cc1d6991ce3110b26a2d97de83 /cmds/app_process/app_main.cpp
parent1ae6ae2094fd0ab8c82ad1a347e7a8bd67d995e5 (diff)
downloadframeworks_base-1fe21bd1b6ca8b94c78fbf3666a1e8e0472355de.zip
frameworks_base-1fe21bd1b6ca8b94c78fbf3666a1e8e0472355de.tar.gz
frameworks_base-1fe21bd1b6ca8b94c78fbf3666a1e8e0472355de.tar.bz2
Never call app_main more than once
Different kernels seem to handle ADDR_COMPAT_LAYOUT differently, sometimes passing it to its children, sometimes not. If it's not passed to its child successfully, we can end up in a restart loop. Instead of testing for the presence of ADDR_COMPAT_LAYOUT, use an environment variable instead, which is handled more predictably. Bug: 8392487 Change-Id: Ia531dd2abb4e1cd46f3430d844e644f53581f530
Diffstat (limited to 'cmds/app_process/app_main.cpp')
-rw-r--r--cmds/app_process/app_main.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index b54774e..80df568 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -12,10 +12,10 @@
#include <utils/Log.h>
#include <cutils/process_name.h>
#include <cutils/memory.h>
-#include <cutils/properties.h>
#include <android_runtime/AndroidRuntime.h>
#include <sys/personality.h>
+#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -144,12 +144,11 @@ int main(int argc, char* const argv[])
* This breaks some programs which improperly embed
* an out of date copy of Android's linker.
*/
- char value[PROPERTY_VALUE_MAX];
- property_get("ro.kernel.qemu", value, "");
- if (strcmp(value, "1") != 0) {
+ if (getenv("NO_ADDR_COMPAT_LAYOUT_FIXUP") == NULL) {
int current = personality(0xFFFFFFFF);
if ((current & ADDR_COMPAT_LAYOUT) == 0) {
personality(current | ADDR_COMPAT_LAYOUT);
+ setenv("NO_ADDR_COMPAT_LAYOUT_FIXUP", "1", 1);
execv("/system/bin/app_process", argv);
return -1;
}