diff options
Diffstat (limited to 'modules/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp')
-rw-r--r-- | modules/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/modules/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp b/modules/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp index 1ee2239fb80..bd1f64dc4dd 100644 --- a/modules/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp +++ b/modules/ACE/tests/SSL/SSL_Asynch_Stream_Test.cpp @@ -146,8 +146,7 @@ static const char *test_string = "SSL_Asynch_Stream_Test!"; 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, @@ -157,17 +156,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; } static void @@ -451,6 +457,9 @@ proactor_loop (void *) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Start handling events.\n"))); + disable_signal (ACE_SIGRTMIN, ACE_SIGRTMAX); + disable_signal (SIGPIPE, SIGPIPE); + int result = ACE_Proactor::instance ()->proactor_run_event_loop (); if (result == -1) @@ -471,6 +480,9 @@ start_clients (void *) ACE_INET_Addr addr (rendezvous); ACE_SSL_SOCK_Connector connect; + disable_signal (ACE_SIGRTMIN, ACE_SIGRTMAX); + disable_signal (SIGPIPE, SIGPIPE); + for (size_t i = 0 ; i < cli_conn_no; i++) { ACE_SSL_SOCK_Stream stream; |