summaryrefslogtreecommitdiff
path: root/ace/Select_Reactor.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-10-23 20:46:54 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-10-23 20:46:54 +0000
commit17ade1d5c11a2c748bbc5a26f962d7ac42e71719 (patch)
tree965651ef0de533b5b4b824f1467597d441f6d477 /ace/Select_Reactor.cpp
parent4e8b06215d6065b35bea417a1888612f038ba9fe (diff)
downloadATCD-17ade1d5c11a2c748bbc5a26f962d7ac42e71719.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Select_Reactor.cpp')
-rw-r--r--ace/Select_Reactor.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/ace/Select_Reactor.cpp b/ace/Select_Reactor.cpp
index c74f7a4e077..1292916eef4 100644
--- a/ace/Select_Reactor.cpp
+++ b/ace/Select_Reactor.cpp
@@ -105,11 +105,20 @@ ACE_Select_Reactor_Handler_Repository::open (size_t size)
ACE_SELECT_REACTOR_EVENT_HANDLER (this, h) = 0;
#endif /* ACE_WIN32 */
+ // Check to see if the user is asking for too much and fail in this
+ // case.
+ if (size > FD_SETSIZE)
+ {
+ errno = ERANGE;
+ return -1;
+ }
+#if defined (RLIMIT_NOFILE)
// Increase the number of handles if <size> is greater than the
// current limit.
- if (size > ACE::max_handles ())
+ if (size < ACE::max_handles ())
return ACE::set_handle_limit (size);
else
+#endif /* RLIMIT_NOFILE */
return 0;
}