[CRIU] [PATCHv3 2/2] zdtm: sysctl net.unix.max_dgram_qlen value preservation test

Cyrill Gorcunov gorcunov at gmail.com
Fri Nov 1 16:45:14 MSK 2019


On Fri, Nov 01, 2019 at 12:00:21PM +0000, Alexander Mikhalitsyn wrote:
...
> +int main(int argc, char **argv)
> +{
> +	test_init(argc, argv);
> +
> +	if (unshare(CLONE_NEWNET)) {
> +		perror("unshare");
> +		return 1;
> +	}
> +
> +	for (sysctl_opt_t *p = net_unix_params; p->path != NULL; p++) {
> +		p->old = (((unsigned)lrand48()) % 1023) + 1;
> +		if (sysctl_write_int(p->path, p->old)) {
> +			pr_perror("Can't change %s", p->path);
> +			return -1;
> +		}
> +	}

Please don't use variable declaration inside for() statement. We're
mostly targeting kernel coding style, not real c99.


More information about the CRIU mailing list