[CRIU] Re: [PATCH 2/6] tty: Squash tty_get_sid, tty_get_pgrp into tty_get_sid_pgrp

Pavel Emelyanov xemul at parallels.com
Fri Sep 14 07:00:24 EDT 2012


On 09/14/2012 02:38 PM, Cyrill Gorcunov wrote:
> 
> This patch squashes tty_get_sid, tty_get_pgrp into
> one tty_get_sid_pgrp helper (which allows to detect
> if dumping terminal is hanging up, the real use of
> this ability will be addressed in next patch).
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  tty.c |   49 +++++++++++++++++++++++++------------------------
>  1 files changed, 25 insertions(+), 24 deletions(-)
> 

> +
> +	*hangup = false;
> +	return 0;
> +
> +err:
> +	if (errno != EIO) {

I can find zero places where TIOCGPGRP or TIOCGSID may result in EIO.
Point one to me.

> +		pr_perror("Can't get sid/pgrp on %d", fd);
> +		return -1;
> +	}
> +
> +	*sid = *pgrp = 0;
> +	*hangup = true;
> +	return 0;
>  }



More information about the CRIU mailing list