Merge "Add persist.zygote.core_dump property for coredumps" am: a36a69a9e6

am: 68b64b2639

Change-Id: Ib69a3d22f969206a6fe8755f69efefce411b14c9
This commit is contained in:
Orion Hodson
2018-12-11 09:00:02 -08:00
committed by android-build-merger

View File

@@ -273,15 +273,17 @@ static void EnableDebugger() {
}
}
// We don't want core dumps, though, so set the soft limit on core dump size
// to 0 without changing the hard limit.
rlimit rl;
if (getrlimit(RLIMIT_CORE, &rl) == -1) {
ALOGE("getrlimit(RLIMIT_CORE) failed");
} else {
rl.rlim_cur = 0;
if (setrlimit(RLIMIT_CORE, &rl) == -1) {
ALOGE("setrlimit(RLIMIT_CORE) failed");
// Set the core dump size to zero unless wanted (see also coredump_setup in build/envsetup.sh).
if (!GetBoolProperty("persist.zygote.core_dump", false)) {
// Set the soft limit on core dump size to 0 without changing the hard limit.
rlimit rl;
if (getrlimit(RLIMIT_CORE, &rl) == -1) {
ALOGE("getrlimit(RLIMIT_CORE) failed");
} else {
rl.rlim_cur = 0;
if (setrlimit(RLIMIT_CORE, &rl) == -1) {
ALOGE("setrlimit(RLIMIT_CORE) failed");
}
}
}
}