[CRIU] [PATCH 5/9] tty: Rework tty_driver structure

Cyrill Gorcunov gorcunov at gmail.com
Fri Mar 13 06:51:59 PDT 2015


On Fri, Mar 13, 2015 at 02:36:09PM +0300, Pavel Emelyanov wrote:
> >  
> >  static int tty_gen_id(struct tty_driver *driver, int index)
> >  {
> > -	return (index << 1) + (driver->t == TTY_TYPE_PTM);
> > +	return (index << 1) + (driver->subtype == TTY_SUBTYPE_MASTER);
> 
> This thing will start working differently for CONSOLE after patching.

This routine is called on dump only and because we're using even numbers
for indices this is fine.

> >  
> > -	if ((type == TTY_TYPE_PTM && tty_is_master(info)) ||
> > -	    (type == TTY_TYPE_PTS && !tty_is_master(info))) {
> > +	if ((subtype == TTY_SUBTYPE_MASTER && tty_is_master(info)) ||
> > +	    (subtype == TTY_SUBTYPE_SLAVE && !tty_is_master(info))) {
> 
> So will this.

Yeah, here might be a nit, Need to revisit, thanks for pointing!

	Cyrill


More information about the CRIU mailing list