[CRIU] Re: [PATCH 1/3] check: Add inotify/epoll/eventfd

Pavel Emelyanov xemul at parallels.com
Fri May 4 08:45:15 EDT 2012


> +	fd = inotify_init();
> +	if (fd < 0) {
> +		pr_msg("inotify: Can't create inotify file\n");
> +		return -1;
> +	}
> +
> +	wd = inotify_add_watch(fd, "/", IN_ALL_EVENTS);
> +	if (wd < 0) {
> +		close(fd);
> +		pr_msg("inotify: Can't add inotify target\n");
> +		return -1;
> +	}
> +
> +	ret = read_self_fdinfo(fd, buf, sizeof(buf));
> +	close(fd);
> +
> +	if (ret || !strstr(buf, "wd:")) {
> +		pr_msg("inotify: Bad format\n");
> +		return -1;
> +	}

I'd prefer if the code, getting info from fdinfo file was shared between
check and dump for all anon types.

> +	return 0;
> +}



More information about the CRIU mailing list