diff options
Diffstat (limited to 'tests/auto/network')
-rw-r--r-- | tests/auto/network/socket/qtcpserver/crashingServer/main.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp b/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp index 25cc100919..c14c429520 100644 --- a/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp +++ b/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp @@ -8,15 +8,23 @@ # include <crtdbg.h> #endif #ifdef Q_OS_UNIX +# include <sys/resource.h> # include <unistd.h> #endif int main(int argc, char *argv[]) { - // Windows: Suppress crash notification dialog. #if defined(Q_OS_WIN) && defined(Q_CC_MSVC) + // Windows: Suppress crash notification dialog. _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG); +#elif defined(RLIMIT_CORE) + // Unix: set our core dump limit to zero to request no dialogs. + if (struct rlimit rlim; getrlimit(RLIMIT_CORE, &rlim) == 0) { + rlim.rlim_cur = 0; + setrlimit(RLIMIT_CORE, &rlim); + } #endif + QCoreApplication app(argc, argv); if (argc < 1) { fprintf(stderr, "Need a port number\n"); |