Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] How to ignore a signal?
From: Boris (boriss_at_[hidden])
Date: 2008-09-18 20:32:34


On Fri, 19 Sep 2008 01:00:09 +0200, Gennadiy Rozental <rogeeff_at_[hidden]>
wrote:

> Boris <boriss <at> web.de> writes:
>> I temporarily hardcoded in boost/test/impl/execution_monitor.ipp:
>>
>> m_CHLD_action( SIGCHLD, false, attach_dbg, alt_stack )
>>
>> That works. If the macro BOOST_TEST_IGNORE_NON_ZERO_CHILD_CODE does the
>> same it should be all right. :)
>
> No. We still want to detect if child is crashed, for example.

I see. Can you change the code then to something like this:

static bool ignore_sigchild( siginfo_t* info )
{
     return info->si_signo == SIGCHLD
#ifdef BOOST_TEST_IGNORE_SIGCHLD
         ;
#else
         && info->si_code == CLD_EXITED
# ifdef BOOST_TEST_IGNORE_NON_ZERO_CHILD_CODE
         ;
# else
         && (int)info->si_status == 0;
# endif
#endif
}

I have another test case where the parent kills the child. Simply ignoring
SIGCHLD is probably the best (as otherwise there have to be too many
preprocessor directives added)?

Boris


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net