[CRIU] Re: [PATCH]

Cyrill Gorcunov gorcunov at openvz.org
Thu Sep 13 08:35:23 EDT 2012


On Thu, Sep 13, 2012 at 04:10:47PM +0400, Pavel Emelyanov wrote:
> On 09/13/2012 03:49 PM, Cyrill Gorcunov wrote:
> > While I've not yet implemented support for slaves ttys without master
> > peers better to  exit with error instead of hanging on restore.
> > 
> > 	Cyrill
> 
> > +int tty_check_orphans(void)
> > +{
> > +	int i;
> > +
> > +	for (i = 0; i < (MAX_TTYS << 1) - 1; i += 2) {
> > +		int a = test_bit(i, tty_bitmap);
> > +		int b = test_bit(i + 1, tty_bitmap);
> > +
> > +		if (a && (a ^ b)) {
> > +			pr_err("Found slave without master\n");
> 
> Why a && a ^ b == slave && !master ?

static int tty_gen_id(int major, int index)
{
	return (index << 1) + (major == TTYAUX_MAJOR);
}

the odd bits are for masters while evens -- for slaves.
The cycle a bit inefficient I should rather use shifts,
but it's temporary solution.


More information about the CRIU mailing list