[CRIU] [PATCH 4/4] net: Make sure the entries exist before read them

Cyrill Gorcunov gorcunov at gmail.com
Tue May 5 04:21:11 PDT 2015


On Tue, May 05, 2015 at 02:16:33PM +0300, Pavel Emelyanov wrote:
> > +
> > +	dir = open("/proc/sys/" NET_CONF_PATH "/all", O_RDONLY);
> > +	if (dir < 0) {
> > +		pr_perror("Can't open sysctl dir");
> > +		return -1;
> > +	}
> > +
> > +	for (i = 0; i < ARRAY_SIZE(devconfs); i++) {
> 
> Can we, instead of this loop, teach sysctl.c to handle missing entries
> itself?

I thought about it, but this cause too many code changes in sysct
code, so i think it should be up to a caller to test if entries
are readable.


More information about the CRIU mailing list