summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ace/OS.i2
-rw-r--r--ace/ReactorEx.cpp8
2 files changed, 7 insertions, 3 deletions
diff --git a/ace/OS.i b/ace/OS.i
index 3be76c3cd98..3f23777440a 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -2679,6 +2679,8 @@ ACE_OS::inet_aton (const char *host_name, struct in_addr *addr)
ACE_OS::memcpy ((void *) addr, (void *) &ip_addr, sizeof ip_addr);
return 1;
}
+ else
+ return 1;
}
ACE_INLINE char *
diff --git a/ace/ReactorEx.cpp b/ace/ReactorEx.cpp
index fb2969f69d2..21bcc46f161 100644
--- a/ace/ReactorEx.cpp
+++ b/ace/ReactorEx.cpp
@@ -212,7 +212,7 @@ ACE_ReactorEx::dispatch (ACE_Event_Handler *wait_all_callback)
int
ACE_ReactorEx::dispatch (size_t index)
{
- while (index < active_handles_)
+ for (;;)
{
// Tim, if this call fails is there really anything we
// can/should do about it? It seems that regardless of the
@@ -221,6 +221,10 @@ ACE_ReactorEx::dispatch (size_t index)
this->dispatch_handler (index);
index++;
+ // We're done.
+ if (index >= this->active_handles_)
+ return 0;
+
DWORD wait_status =
::WaitForMultipleObjects (active_handles_ - index,
&handles_[index],
@@ -244,8 +248,6 @@ ACE_ReactorEx::dispatch (size_t index)
index += waitstatus - WAIT_ABANDONED_0;
}
}
-
- return 0;
}
// Dispatches a single handler. Returns 0 on success, -1 if the