[CRIU] [PATCH] zdtm: pty00 -- Count for SIGHUP, v2

Pavel Emelyanov xemul at parallels.com
Fri Aug 15 06:10:37 PDT 2014


On 08/15/2014 05:08 PM, Cyrill Gorcunov wrote:
> On Fri, Aug 15, 2014 at 05:02:14PM +0400, Cyrill Gorcunov wrote:
>>>
>>> You can leave sigaction where it's now and check the counter before
>>> closing the master point.
>>
>> OK.
> 
> Attached
> 
> @@ -54,7 +66,14 @@ int main(int argc, char ** argv)
>  
>  	test_waitsig();
>  
> -	signal(SIGHUP, SIG_IGN);
> +	/*
> +	 * On closing control terminal we're expecting to
> +	 * receive SIGHUP, so make sure it's delivered.
> +	 */
> +	if (sigaction(SIGHUP, &sa, 0)) {

Too late here. Unexpected HUP from CRIU may happen right after waitsig above.

> +		fail("sigaction failed\n");
> +		return 1;
> +	}
>  
>  	/* Check connectivity */
>  	ret = write(fdm, teststr, sizeof(teststr) - 1);




More information about the CRIU mailing list