[LTP] [PATCH 6/7] syscalls/clone06: Convert to new API

Cyril Hrubis chrubis@suse.cz
Wed Aug 25 16:43:03 CEST 2021


Hi!
> +	if (!TST_PASS)
> +		return;
> +
> +	SAFE_CLOSE(pfd[1]);
> +	SAFE_READ(1, pfd[0], buff, sizeof(buff));
> +	SAFE_CLOSE(pfd[0]);
> 
> -	cleanup();
> -	tst_exit();
> +	parent_env = getenv("TERM") ? : "";
> +	TST_EXP_PASS(strcmp(buff, parent_env),
> +				"verify environment variables by child");

This is misuse as well. I guess TST_EXP_VAL() could be useable in this
case as well.

>  }
> 
>  static void setup(void)
>  {
> -	tst_sig(FORK, DEF_HANDLER, cleanup);
> -	TEST_PAUSE;
> +	child_stack = SAFE_MALLOC(CHILD_STACK_SIZE);
> +	SAFE_PIPE(pfd);

Here as well it would be easier to use a shared memory as IPC.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list