diff options
Diffstat (limited to 'ACE/tests/Proactor_Test_IPV6.cpp')
-rw-r--r-- | ACE/tests/Proactor_Test_IPV6.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/ACE/tests/Proactor_Test_IPV6.cpp b/ACE/tests/Proactor_Test_IPV6.cpp index f1cc290b93a..c6de6ef20aa 100644 --- a/ACE/tests/Proactor_Test_IPV6.cpp +++ b/ACE/tests/Proactor_Test_IPV6.cpp @@ -16,10 +16,6 @@ #include "test_config.h" -ACE_RCSID (tests, - Proactor_Test, - "$Id$") - #if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)) // This only works on Win32 platforms and on Unix platforms // supporting POSIX aio calls. @@ -122,8 +118,7 @@ public: static int disable_signal (int sigmin, int sigmax) { -#ifndef ACE_WIN32 - +#if !defined (ACE_LACKS_UNIX_SIGNALS) sigset_t signal_set; if (ACE_OS::sigemptyset (&signal_set) == - 1) ACE_ERROR ((LM_ERROR, @@ -133,17 +128,24 @@ disable_signal (int sigmin, int sigmax) for (int i = sigmin; i <= sigmax; i++) ACE_OS::sigaddset (&signal_set, i); - // Put the <signal_set>. - if (ACE_OS::pthread_sigmask (SIG_BLOCK, &signal_set, 0) != 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Error: (%P|%t):%p\n"), - ACE_TEXT ("pthread_sigmask failed"))); + // Put the <signal_set>. +# if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) + // In multi-threaded application this is not POSIX compliant + // but let's leave it just in case. + if (ACE_OS::sigprocmask (SIG_BLOCK, &signal_set, 0) != 0) +# else + if (ACE_OS::thr_sigsetmask (SIG_BLOCK, &signal_set, 0) != 0) +# endif /* ACE_LACKS_PTHREAD_THR_SIGSETMASK */ + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Error: (%P|%t): %p\n"), + ACE_TEXT ("SIG_BLOCK failed")), + -1); #else ACE_UNUSED_ARG (sigmin); ACE_UNUSED_ARG (sigmax); -#endif /* ACE_WIN32 */ +#endif /* ACE_LACKS_UNIX_SIGNALS */ - return 1; + return 0; } @@ -203,7 +205,7 @@ MyTask::create_proactor (ProactorType type_proactor, size_t max_op) this->lock_, -1); - ACE_ASSERT (this->proactor_ == 0); + ACE_TEST_ASSERT (this->proactor_ == 0); #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) @@ -348,6 +350,7 @@ MyTask::svc (void) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) MyTask started\n"))); disable_signal (ACE_SIGRTMIN, ACE_SIGRTMAX); + disable_signal (SIGPIPE, SIGPIPE); // signal that we are ready sem_.release (1); @@ -945,7 +948,7 @@ Server::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) else mb.release (); - this->io_count_--; + --this->io_count_; if (this->io_count_ > 0) return; } @@ -1041,7 +1044,7 @@ Server::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result) this->initiate_read_stream (); } - this->io_count_--; + --this->io_count_; if (this->io_count_ > 0) return; } @@ -1627,7 +1630,7 @@ Client::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result) this->initiate_read_stream (); } - this->io_count_--; + --this->io_count_; if (this->io_count_ > 0) return; } @@ -1744,7 +1747,7 @@ Client::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) this->initiate_write_stream (); } - this->io_count_--; + --this->io_count_; if (this->io_count_ > 0) return; } |