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

Commit fe57f62c authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am 9c322c75: am f7ec4e61: Merge "Never call app_main more than once"

* commit '9c322c75':
  Never call app_main more than once
parents 868adf73 9c322c75
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -12,10 +12,10 @@
#include <utils/Log.h>
#include <utils/Log.h>
#include <cutils/process_name.h>
#include <cutils/process_name.h>
#include <cutils/memory.h>
#include <cutils/memory.h>
#include <cutils/properties.h>
#include <android_runtime/AndroidRuntime.h>
#include <android_runtime/AndroidRuntime.h>
#include <sys/personality.h>
#include <sys/personality.h>


#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <unistd.h>
#include <unistd.h>


@@ -144,12 +144,11 @@ int main(int argc, char* const argv[])
     * This breaks some programs which improperly embed
     * This breaks some programs which improperly embed
     * an out of date copy of Android's linker.
     * an out of date copy of Android's linker.
     */
     */
    char value[PROPERTY_VALUE_MAX];
    if (getenv("NO_ADDR_COMPAT_LAYOUT_FIXUP") == NULL) {
    property_get("ro.kernel.qemu", value, "");
    if (strcmp(value, "1") != 0) {
        int current = personality(0xFFFFFFFF);
        int current = personality(0xFFFFFFFF);
        if ((current & ADDR_COMPAT_LAYOUT) == 0) {
        if ((current & ADDR_COMPAT_LAYOUT) == 0) {
            personality(current | ADDR_COMPAT_LAYOUT);
            personality(current | ADDR_COMPAT_LAYOUT);
            setenv("NO_ADDR_COMPAT_LAYOUT_FIXUP", "1", 1);
            execv("/system/bin/app_process", argv);
            execv("/system/bin/app_process", argv);
            return -1;
            return -1;
        }
        }