[LTP] [PATCH v4 3/4] syscalls/msgstress03: fix fork failure on small memory systems

Cyril Hrubis chrubis@suse.cz
Thu Aug 19 17:58:33 CEST 2021


Hi!
> +	free_pids = tst_get_free_pids(cleanup);
> +	if (free_pids < 0) {
> +		tst_brkm(TBROK, cleanup, "Can't obtain free_pid count");
> +	} else if (!free_pids) {
> +		tst_brkm(TBROK, cleanup, "No free pids");
> +	}

This looks like copy&paste from msgstress04.c, can we please move this
snippet to the library function instead?

> +	if (nprocs >= free_pids) {
> +		tst_resm(TINFO,
> +			 "Requested number of processes higher than limit (%d > %d), "
> +			 "setting to %d", nprocs, free_pids, free_pids);
> +		nprocs = free_pids;
> +	}
> +
>  	srand(getpid());
>  	tid = -1;
>  
> -- 
> 2.27.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list