summaryrefslogtreecommitdiff
path: root/lib/cpp/src
diff options
context:
space:
mode:
authorBen Craig <bencraig@apache.org>2013-10-09 15:23:49 -0500
committerBen Craig <bencraig@apache.org>2013-10-09 15:23:49 -0500
commit96ea9daf806a0de09fdd0c6948c0bbb7eab82004 (patch)
treea914e1d63fa0a2f841b9cd9ae07a7f8d0694c9dd /lib/cpp/src
parent6493523e96df96069c94647c5e9b841b0be491a6 (diff)
downloadthrift-96ea9daf806a0de09fdd0c6948c0bbb7eab82004.tar.gz
THRIFT-1751: definition of increase_max_fds doesn't compile when
HAVE_SYS_RESOURCE_H is not defined Client: cpp Patch: Ben Craig
Diffstat (limited to 'lib/cpp/src')
-rwxr-xr-xlib/cpp/src/thrift/server/TServer.cpp2
-rw-r--r--lib/cpp/src/thrift/server/TServer.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/cpp/src/thrift/server/TServer.cpp b/lib/cpp/src/thrift/server/TServer.cpp
index f4ce7441b..5e82ce687 100755
--- a/lib/cpp/src/thrift/server/TServer.cpp
+++ b/lib/cpp/src/thrift/server/TServer.cpp
@@ -32,6 +32,7 @@
namespace apache { namespace thrift { namespace server {
+#ifdef HAVE_SYS_RESOURCE_H
int increase_max_fds(int max_fds=(1<<24)) {
struct rlimit fdmaxrl;
@@ -43,5 +44,6 @@ int increase_max_fds(int max_fds=(1<<24)) {
return static_cast<int>(fdmaxrl.rlim_cur);
}
+#endif
}}} // apache::thrift::server
diff --git a/lib/cpp/src/thrift/server/TServer.h b/lib/cpp/src/thrift/server/TServer.h
index c9e88b183..7f718da53 100644
--- a/lib/cpp/src/thrift/server/TServer.h
+++ b/lib/cpp/src/thrift/server/TServer.h
@@ -307,8 +307,9 @@ public:
* for the current process and all of its children.
* By default, tries to increase it to as much as 2^24.
*/
+#ifdef HAVE_SYS_RESOURCE_H
int increase_max_fds(int max_fds=(1<<24));
-
+#endif
}}} // apache::thrift::server