From 4effe54ffa6c2f727846c5d802ebca44c4731c17 Mon Sep 17 00:00:00 2001 From: schmidt Date: Mon, 3 Nov 1997 00:08:48 +0000 Subject: *** empty log message *** --- ChangeLog-97b | 10 +++++++++- ace/ACE.cpp | 18 +++++++++++------- ace/Select_Reactor.i | 4 ++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog-97b b/ChangeLog-97b index 5577a12023d..5d890a56cce 100644 --- a/ChangeLog-97b +++ b/ChangeLog-97b @@ -1,5 +1,13 @@ Sun Nov 2 15:31:45 1997 Douglas C. Schmidt + * ace/Select_Reactor.i (cancel_timer): Make sure that we don't try + to call cancel() through a NULL this->timer_queue_. Thanks to + Stephen Coy for reporting this. + + * ace/ACE.cpp (set_handle_limit): Fixed a subtle bug that occurs + if the OS doesn't like non-initialized rlimit structs. Thanks + to Stephen Coy for reporting this. + * examples/System_V_IPC/SV_Semaphores/Semaphores_2.cpp (main): Renamed allocator to my_alloc to work around wonderful STL and GCC problems... Thanks to Ben Eng for @@ -97,7 +105,7 @@ Fri Oct 31 14:35:37 1997 David L. Levine Fri Oct 31 00:53:52 1997 * The following five changes were suggested by Stephen Coy - . Thanks Stephen. + . Thanks Stephen. * ace/OS.h (ACE_CLASS_IS_NAMESPACE): Changed friend ace_dewarn_gplusplus to friend class ace_dewarn_gplusplus. diff --git a/ace/ACE.cpp b/ace/ACE.cpp index acd6a1d0163..ec72b13182b 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -1491,15 +1491,19 @@ ACE::set_handle_limit (int new_limit) ACE_TRACE ("ACE::set_handle_limit"); #if defined (RLIMIT_NOFILE) struct rlimit rl; + + if (ACE_OS::getrlimit (RLIMIT_NOFILE, &rl) != -1) + { + int max_handles = rl.rlim_cur; - int max_handles = ACE::max_handles (); - - if (new_limit < 0 || new_limit > max_handles) - rl.rlim_cur = max_handles; + if (new_limit < 0 || new_limit > max_handles) + rl.rlim_cur = max_handles; + else + rl.rlim_cur = new_limit; + return ACE_OS::setrlimit (RLIMIT_NOFILE, &rl); + } else - rl.rlim_cur = new_limit; - - return ACE_OS::setrlimit (RLIMIT_NOFILE, &rl); + return -1; #else new_limit = new_limit; ACE_NOTSUP_RETURN (-1); diff --git a/ace/Select_Reactor.i b/ace/Select_Reactor.i index 91e318cc85a..03def73b115 100644 --- a/ace/Select_Reactor.i +++ b/ace/Select_Reactor.i @@ -123,8 +123,8 @@ ACE_Select_Reactor::cancel_timer (ACE_Event_Handler *handler, int dont_call_handle_close) { ACE_TRACE ("ACE_Select_Reactor::cancel_timer"); - return this->timer_queue_->cancel (handler, - dont_call_handle_close); + return this->timer_queue_ != 0 && + this->timer_queue_->cancel (handler, dont_call_handle_close); } ACE_INLINE int -- cgit v1.2.1