[CRIU] [PATCH] service: SIGCHLD handler

Ruslan Kuprieiev kupruser at gmail.com
Thu Oct 31 11:34:08 PDT 2013


On 31.10.2013 05:36, Ruslan Kuprieiev wrote:
> On 31.10.2013 01:23, Andrew Vagin wrote:
>> On Thu, Oct 31, 2013 at 04:51:47AM +0400, Ruslan Kuprieiev wrote:
>>>>> @@ -323,16 +368,31 @@ int cr_service(bool daemon_mode)
>>>>>           }
>>>>>       }
>>>>> -    /* FIXME Do not ignore children's return values */
>>>>> -    signal(SIGCHLD, SIG_IGN);
>>>>> +    /* Set SIGCHLD handler */
>>>>> +    sigemptyset(&block_mask);
>>>>> +
>>>>> +    sigaddset(&block_mask, SIGCHLD);
>>>>> +
>>>>> +    /* FIXME May need to block some other signals too */
>>>> I think we don't need to block only SIGCHLD.
>>> If we will not block SIGCHLD, it may be received during treating the
>>> status by handler.
>>> In v2 patch, still block SIGCHLD, but handler works until there is
>>> no children that have changed their status.
>>>
>> Of course I wanted to say that we need to block only SIGCHLD;)
> Oh, I thought it wouldn't be nice, if someone will interrupt handler, 
> when it will be writing to logfile, so I add more signals to mask(see 
> patchv2) :)

Pavel, what about this patch?


More information about the CRIU mailing list