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

Commit cbd1bfb6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Call exit instead of _exit when compiled with clang coverage" into main...

Merge "Call exit instead of _exit when compiled with clang coverage" into main am: 0c175e28 am: fa58b4a9 am: 32df7715 am: 79dc06e4 am: 43183785

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2780904



Change-Id: I9affbede7282212cfa4d147aeb732e28716b7407
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cbff326c 43183785
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1315,7 +1315,16 @@ void AndroidRuntime::exit(int code)
        ALOGI("VM exiting with result code %d.", code);
        onExit(code);
    }

#ifdef __ANDROID_CLANG_COVERAGE__
    // When compiled with coverage, a function is registered with atexit to call
    // `__llvm_profile_write_file` when the process exit.
    // For Clang code coverage to work, call exit instead of _exit to run hooks
    // registered with atexit.
    ::exit(code);
#else
    ::_exit(code);
#endif
}

void AndroidRuntime::onVmCreated(JNIEnv* env)