[LTP] [PATCH v2 2/3] syscalls: refactor vfork01 using new API

Cyril Hrubis chrubis@suse.cz
Thu Mar 5 16:03:24 CET 2026


Hi!
> -	/*
> -	 * Get the device number and the inode number of "." (current-
> -	 * working directory) for the parent process.
> -	 */
> -	if (stat(Pcwd, &Stat_cwd_Pbuf) < 0) {
> -		tst_brkm(TFAIL, cleanup, "stat(2) failed to get info. of "
> -			 "working directory in parent process");
> -	}
> +	if (p_cwd)
> +		free(p_cwd);

free(NULL) is no-op, the if () is not needed.

Otherwise:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list