[LTP] [PATCH 5/7] syscalls/clone05: Convert to new API

zhanglianjie zhanglianjie@uniontech.com
Thu Aug 26 13:10:45 CEST 2021


Hi,

>> +static void verify_clone(void)
>> +{
>> +	TST_EXP_POSITIVE(ltp_clone(CLONE_VM | CLONE_VFORK | SIGCHLD, child_fn, NULL,
>> +					CHILD_STACK_SIZE, child_stack), "clone with vfork");
>>
>> -	free(child_stack);
>> +	if (!TST_PASS)
>> +		return;
>>
>> -	cleanup();
>> -	tst_exit();
>> +	TST_EXP_PASS(!child_exited);
> 
> This is misuse of the macro, since the macro checks for -1 on failure
> and we will get 1 on failure here.
> 
> I guess that we should add TST_EXP_VAL() instead for cases like this and
> we would do:
> 
> 	TST_EXP_VAL(child_exited, 1);
> 
> Will you send a patch or should I add it?
> 
I will send patch to add TST_EXP_VAL, thank you.

-- 
Regards,
Zhang Lianjie




More information about the ltp mailing list