diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-03 18:17:41 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-05-04 20:15:36 -0700 |
commit | 30067d102cbe517203ae693ff17083c5f0c3187f (patch) | |
tree | efdb026853b10c4691fd502d598847dc13d6280d /src/testlib | |
parent | f7152a4bb78676cb211ac3c3e1e59aa53a307491 (diff) |
qtestcase.cpp: use #ifdef RLIMIT_CORE to guard RLIMIT_CORE usage
Instead of trying to guess which OSes have this functionality.
Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16ebc20fe7eca346
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestcase.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 5850596a8c..1af06f74c2 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -191,17 +191,17 @@ static bool hasSystemCrashReporter() static void disableCoreDump() { +#ifdef RLIMIT_CORE bool ok = false; const int disableCoreDump = qEnvironmentVariableIntValue("QTEST_DISABLE_CORE_DUMP", &ok); if (ok && disableCoreDump) { -#if defined(Q_OS_UNIX) && !defined(Q_OS_INTEGRITY) struct rlimit limit; limit.rlim_cur = 0; limit.rlim_max = 0; if (setrlimit(RLIMIT_CORE, &limit) != 0) qWarning("Failed to disable core dumps: %d", errno); -#endif } +#endif } Q_CONSTRUCTOR_FUNCTION(disableCoreDump); |