diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-05-14 13:08:46 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@digia.com> | 2014-05-14 14:09:05 +0200 |
commit | 8f8800de7ab89e6cbc7b5eb08f2b3f16407e6cdf (patch) | |
tree | f0f7ca1b311472dd992a7e34736ab19e849425e8 /src | |
parent | 7d7e09ad17468e96f85dc11af51209382a9c0764 (diff) |
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 <karsten.heimrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/sdk/installerbase.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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 |