Having explicit locators is not a sufficient condition to be able to have

children for a pseudo-device.  Depending on an interface attribute is,
though.

Instead of looking at locators, walk the 'attrs' list and look for an
interface attribute (which might have been added just a few lines before
in case there was explicit locators defined).

Fixes PR#32329 by Valeriy E. Ushakov.  Regression test is PSEUDO_PARENT.
This commit is contained in:
cube 2005-12-18 23:43:15 +00:00
parent 902411e7f8
commit c454f920b9
1 changed files with 12 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sem.c,v 1.16 2005/11/07 18:45:34 erh Exp $ */
/* $NetBSD: sem.c,v 1.17 2005/12/18 23:43:15 cube Exp $ */
/*
* Copyright (c) 1992, 1993
@ -351,11 +351,17 @@ defdev(struct devbase *dev, struct nvlist *loclist, struct nvlist *attrs,
attrs = newnv(dev->d_name, NULL, getattr(dev->d_name), 0,
attrs);
/*
* Pseudo-devices can have children. Consider them as
* attaching at root.
*/
if (ispseudo)
}
/*
* Pseudo-devices can have children. Consider them as
* attaching at root.
*/
if (ispseudo) {
for (nv = attrs; nv != NULL; nv = nv->nv_next)
if (((struct attr *)(nv->nv_ptr))->a_iattr)
break;
if (nv != NULL)
ht_insert(devroottab, dev->d_name, dev);
}