===== boost/test/impl/execution_monitor.ipp 1.1 vs edited ===== --- 1.1/boost/test/impl/execution_monitor.ipp 2008-11-06 13:51:09 +00:00 +++ edited/boost/test/impl/execution_monitor.ipp 2008-11-14 15:14:42 +00:00 @@ -153,6 +153,7 @@ !defined(__NetBSD__) && \ !defined(__QNXNTO__) # define BOOST_TEST_CATCH_SIGPOLL + # endif # ifdef BOOST_TEST_USE_ALT_STACK @@ -477,13 +478,24 @@ "high priority input available; band event %d", (int)m_sig_info->si_band ); break; -#if defined(POLL_ERR) && defined(POLL_HUP) && (POLL_ERR - POLL_HUP) - case POLL_HUP: - report_error( execution_exception::system_error, - "device disconnected; band event %d", - (int)m_sig_info->si_band ); + default: + // the original code tried to use a #if defined to put in a case + // statement into this switch: + // #if defined(POLL_ERR) && defined(POLL_HUP) && (POLL_ERR - POLL_HUP) + // However, that fell foul of the prepreprocessor as POLL_HUP + // and POLL_ERR were defined but not as simple constants and + // so the preprocessor couldn't evaluate (POLL_ERR - POLL_HUP). + if ( m_sig_info->si_code == POLL_HUP ) { + report_error( execution_exception::system_error, + "device disconnected; band event %d", + (int)m_sig_info->si_band ); + } else { + report_error( execution_exception::system_error, + "unrecognised sigpoll event %d; band event %d", + (int)m_sig_info->si_code, + (int)m_sig_info->si_band ); + } break; -#endif } break; @@ -675,7 +687,8 @@ ::alarm( 0 ); #ifdef BOOST_TEST_USE_ALT_STACK - stack_t sigstk = {}; + stack_t sigstk; + std::memset( &sigstk, 0, sizeof(stack_t) ); sigstk.ss_size = MINSIGSTKSZ; sigstk.ss_flags = SS_DISABLE;