aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bt_cl.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2019-02-13 15:50:09 +0200
committerDavid Goulet <dgoulet@torproject.org>2019-02-20 12:06:26 -0500
commitb7ad8bcaad093a5d043c63f30c196c52741830d2 (patch)
tree6b0ea57fac566e2d67170804976a5ba4cb69ae31 /src/test/test_bt_cl.c
parentc320c52e89d0d950f0316d2c2f070f7adca66c80 (diff)
downloadtor-b7ad8bcaad093a5d043c63f30c196c52741830d2.tar.gz
tor-b7ad8bcaad093a5d043c63f30c196c52741830d2.zip
Use setrlimit instead of ulimit -c in backtrace tests
Diffstat (limited to 'src/test/test_bt_cl.c')
-rw-r--r--src/test/test_bt_cl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_bt_cl.c b/src/test/test_bt_cl.c
index 0c15a02ee4..08b08ba423 100644
--- a/src/test/test_bt_cl.c
+++ b/src/test/test_bt_cl.c
@@ -4,6 +4,9 @@
#include "orconfig.h"
#include <stdio.h>
#include <stdlib.h>
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
/* To prevent 'assert' from going away. */
#undef TOR_COVERAGE
@@ -88,6 +91,11 @@ main(int argc, char **argv)
return 1;
}
+#ifdef HAVE_SYS_RESOURCE_H
+ struct rlimit rlim = { .rlim_cur = 0, .rlim_max = 0 };
+ setrlimit(RLIMIT_CORE, &rlim);
+#endif
+
#if !(defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && \
defined(HAVE_BACKTRACE_SYMBOLS_FD) && defined(HAVE_SIGACTION))
puts("Backtrace reporting is not supported on this platform");