Ticket #2498: 2498.patch

File 2498.patch, 2.1 KB (added by ANDREW CHITTENDEN <andyc@…>, 14 years ago)

attached patch clears up the error.

  • boost/test/impl/execution_monitor.ipp

    ===== boost/test/impl/execution_monitor.ipp 1.1 vs edited =====
    old new  
    153153      !defined(__NetBSD__)                                                  && \
    154154      !defined(__QNXNTO__)
    155155#    define BOOST_TEST_CATCH_SIGPOLL
     156
    156157#  endif
    157158
    158159#  ifdef BOOST_TEST_USE_ALT_STACK
     
    477478                          "high priority input available; band event %d",
    478479                          (int)m_sig_info->si_band );
    479480            break;
    480 #if defined(POLL_ERR) && defined(POLL_HUP) && (POLL_ERR - POLL_HUP)
    481         case POLL_HUP:
    482             report_error( execution_exception::system_error,
    483                           "device disconnected; band event %d",
    484                           (int)m_sig_info->si_band );
     481        default:
     482            // the original code tried to use a #if defined to put in a case
     483            // statement into this switch:
     484            // #if defined(POLL_ERR) && defined(POLL_HUP) && (POLL_ERR - POLL_HUP)
     485            // However, that fell foul of the prepreprocessor as POLL_HUP
     486            // and POLL_ERR were defined but not as simple constants and
     487            // so the preprocessor couldn't evaluate (POLL_ERR - POLL_HUP).
     488            if ( m_sig_info->si_code == POLL_HUP ) {
     489                report_error( execution_exception::system_error,
     490                              "device disconnected; band event %d",
     491                              (int)m_sig_info->si_band );
     492            } else {
     493                report_error( execution_exception::system_error,
     494                              "unrecognised sigpoll event %d; band event %d",
     495                              (int)m_sig_info->si_code,
     496                              (int)m_sig_info->si_band );
     497            }
    485498            break;
    486 #endif
    487499        }
    488500        break;
    489501
     
    675687        ::alarm( 0 );
    676688
    677689#ifdef BOOST_TEST_USE_ALT_STACK
    678     stack_t sigstk = {};
     690    stack_t sigstk;
     691    std::memset( &sigstk, 0, sizeof(stack_t) );
    679692
    680693    sigstk.ss_size  = MINSIGSTKSZ;
    681694    sigstk.ss_flags = SS_DISABLE;