[CRIU] [PATCH 5/5] tty: Use regular files engine to save paths to the peers, v3

Pavel Emelyanov xemul at parallels.com
Wed Oct 15 03:46:27 PDT 2014


> @@ -988,6 +1168,25 @@ static int collect_one_tty(void *obj, ProtobufCMessage *msg)
>  	if (verify_info(info))
>  		return -1;
>  
> +	info->reg_d = find_file_desc_raw(FD_TYPES__REG, info->tfe->id);

Does this even succeed? The file_desc_add() on info->tfe->id happens at the end
of this function.

> +	if (!info->reg_d) {
> +		info->reg_d = pty_alloc_fake_reg_d(info, true);
> +		if (!info->reg_d) {
> +			pr_err("Can't generate new reg_d descriptor for id %#x\n",
> +			       info->tfe->id);
> +			return -1;
> +		}
> +	}
> +
> +	/*
> +	 * Slave PTYs without master might have
> +	 * been postfixed as deleted, strip this
> +	 * part, we will need a valid path on their
> +	 * opening.
> +	 */
> +	if (info->type == TTY_TYPE_PTS)
> +		pty_undelete_reg(info);
> +
>  	/*
>  	 * The tty peers which have no @termios are hung up,
>  	 * so don't mark them as active, we create them with



More information about the CRIU mailing list