summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2020-04-20 13:34:42 +0800
committerluwenpeng <[email protected]>2020-04-20 13:34:42 +0800
commitd2d9dd65b3b9b13fda77aae18f35b71812a76e71 (patch)
treecc0f87a22ffdf016d5362b8efc26c6a151d94a7c
parentcc89b5bbe92d5f730da08f55fd35be32391ef31a (diff)
TSG-1009 增加配置项 disable_coredump
-rw-r--r--platform/src/proxy.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp
index 919426e..a4663a6 100644
--- a/platform/src/proxy.cpp
+++ b/platform/src/proxy.cpp
@@ -550,6 +550,18 @@ struct breakpad_instance * breakpad_init(const char * profile)
assert(instance != nullptr);
int ret = 0;
+ unsigned int disable_coredump;
+ MESA_load_profile_uint_def(profile, "system", "disable_coredump", &disable_coredump, 0);
+ if (disable_coredump > 0)
+ {
+ const struct rlimit __rlimit_vars = {.rlim_cur = 0, .rlim_max = 0};
+ ret = setrlimit(RLIMIT_CORE, &__rlimit_vars);
+ if (ret < 0)
+ {
+ TFE_LOG_ERROR(g_default_logger, "setrlimit(RLIMIT_CORE, 0) failed: %s", strerror(errno));
+ }
+ }
+
MESA_load_profile_uint_def(profile, "system", "enable_breakpad", &instance->en_breakpad, 1);
if (instance->en_breakpad <= 0)
{