summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2000-05-25 03:22:07 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2000-05-25 03:22:07 +0000
commitf5d77808b663cdc0d9027010583b1764ea7c4d8b (patch)
treecac29f7dbbeb4d18729809c904bd75c5ce559c80
parent05639ac5c9403cf66ecab193c563ad7d27b9ef94 (diff)
downloadATCD-f5d77808b663cdc0d9027010583b1764ea7c4d8b.tar.gz
ChangeLogTag:Wed May 24 20:18:59 2000 Ossama Othman <ossama@uci.edu>
-rw-r--r--ace/Select_Reactor_Base.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp
index cfd6d183f35..baca4ca60f3 100644
--- a/ace/Select_Reactor_Base.cpp
+++ b/ace/Select_Reactor_Base.cpp
@@ -102,9 +102,21 @@ ACE_Select_Reactor_Handler_Repository::open (size_t size)
ACE_SELECT_REACTOR_EVENT_HANDLER (this, h) = 0;
#endif /* ACE_WIN32 */
- // Try to increase the number of handles if <size> is greater than
- // the current limit.
- return ACE::set_handle_limit (size);
+ // Check to see if the user is asking for too much and fail in this
+ // case.
+ if (size > FD_SETSIZE)
+ {
+ errno = ERANGE;
+ return -1;
+ }
+ else
+ {
+ // Try to increase the number of handles if <size> is greater than
+ // the current limit. We ignore the return value here because this
+ // is more of a "warning" not an error.
+ (void) ACE::set_handle_limit (size);
+ return 0;
+ }
}
// Initialize a repository of the appropriate <size>.