summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-07-11 12:42:53 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-07-11 12:42:53 -0400
commitd7b7953705b1fc22f0803b428fedfde36c5ddcaa (patch)
tree679fc4ad494a44cc1d962c01ab2ce307ac2dbf16 /libs
parent4eff7b4e822d71897ebf938250b732499a3bc7ab (diff)
Use pbd/resource.h in PBD::FileManager
Diffstat (limited to 'libs')
-rw-r--r--libs/pbd/file_manager.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/pbd/file_manager.cc b/libs/pbd/file_manager.cc
index 72eeeb2524..e02bcc2b0d 100644
--- a/libs/pbd/file_manager.cc
+++ b/libs/pbd/file_manager.cc
@@ -18,7 +18,6 @@
*/
#include <sys/time.h>
-#include <sys/resource.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -31,6 +30,7 @@
#include "pbd/compose.h"
#include "pbd/file_manager.h"
+#include "pbd/resource.h"
#include "pbd/debug.h"
using namespace std;
@@ -41,12 +41,11 @@ FileManager* FileDescriptor::_manager;
FileManager::FileManager ()
: _open (0)
{
- struct rlimit rl;
- int const r = getrlimit (RLIMIT_NOFILE, &rl);
+ struct ResourceLimit rl;
/* XXX: this is a bit arbitrary */
- if (r == 0) {
- _max_open = rl.rlim_cur - 64;
+ if (get_resource_limit (OpenFiles, rl)) {
+ _max_open = rl.current_limit - 64;
} else {
_max_open = 256;
}