From 8f8800de7ab89e6cbc7b5eb08f2b3f16407e6cdf Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 14 May 2014 13:08:46 +0200 Subject: Avoid 'Too many open files' on Mac Increase the number of file descriptors that the process can open to the maximum allowed. By default, Mac OS X only allows 256 file descriptors, which can easily be reached. Change-Id: Ie4e5ab1051d8e3bf1cb39747f629360915a22d97 Reviewed-by: Karsten Heimrich --- src/sdk/installerbase.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 3629cc22f..a3141def9 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2012-2013 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2012-2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Installer Framework. @@ -103,6 +103,14 @@ static QStringList repositories(const QStringList &arguments, const int index) int main(int argc, char *argv[]) { +// increase maximum numbers of file descriptors +#if defined (Q_OS_MAC) + struct rlimit rl; + getrlimit(RLIMIT_NOFILE, &rl); + rl.rlim_cur = qMin((rlim_t)OPEN_MAX, rl.rlim_max); + setrlimit(RLIMIT_NOFILE, &rl); +#endif + QStringList args = QInstaller::parseCommandLineArgs(argc, argv); // hack to use cleanlooks if it is under Ubuntu -- cgit v1.2.3