[CRIU] [PATCH 5/5] tty: allocate a separate tty info id for each external tty

Cyrill Gorcunov gorcunov at gmail.com
Thu Sep 27 10:42:22 MSK 2018


On Thu, Sep 27, 2018 at 10:01:49AM +0300, Andrei Vagin wrote:
>  
> +static int ext_fd_get_index(int fd, const struct fd_parms *p)
> +{
> +	static int index;
> +
> +	index++;
> +
> +	if (index + ETTY_INDEX > ETTY_INDEX_MAX) {
> +		pr_err("Too many external terminals");
> +		return INDEX_ERR;
> +	}
> +
> +	return index;
> +}

Should not here be

	return index + ETTY_INDEX;

instead? Other than that looks ok to me.


More information about the CRIU mailing list