-/* $OpenBSD: dev.c,v 1.86 2021/01/29 11:21:00 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.87 2021/01/29 11:31:28 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
i++;
}
s->dev = d;
- s->mask = 1 << i;
+ s->self = 1 << i;
if (!dev_ref(d))
return NULL;
s->ops = ops;
s->arg = arg;
for (c = d->ctl_list; c != NULL; c = c->next)
- c->refs_mask |= s->mask;
+ c->refs_mask |= s->self;
return s;
}
pc = &s->dev->ctl_list;
while ((c = *pc) != NULL) {
- c->refs_mask &= ~s->mask;
+ c->refs_mask &= ~s->self;
if (c->refs_mask == 0) {
*pc = c->next;
xfree(c);
-/* $OpenBSD: dev.h,v 1.34 2021/01/29 11:21:00 ratchov Exp $ */
+/* $OpenBSD: dev.h,v 1.35 2021/01/29 11:31:28 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
struct ctlops *ops;
void *arg;
struct dev *dev;
- unsigned int mask;
+ unsigned int self; /* equal to (1 << index) */
unsigned int mode;
};
-/* $OpenBSD: sock.c,v 1.38 2021/01/29 10:55:19 ratchov Exp $ */
+/* $OpenBSD: sock.c,v 1.39 2021/01/29 11:31:28 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
}
if (m->u.ctlsub.desc) {
if (!(f->ctlops & SOCK_CTLDESC)) {
- ctl = f->ctlslot->mask;
+ ctl = f->ctlslot->self;
c = f->ctlslot->dev->ctl_list;
while (c != NULL) {
c->desc_mask |= ctl;
*/
if (f->ctlslot && (f->ctlops & SOCK_CTLDESC)) {
desc = f->ctldesc;
- mask = f->ctlslot->mask;
+ mask = f->ctlslot->self;
size = 0;
pc = &f->ctlslot->dev->ctl_list;
while ((c = *pc) != NULL) {
}
}
if (f->ctlslot && (f->ctlops & SOCK_CTLVAL)) {
- mask = f->ctlslot->mask;
+ mask = f->ctlslot->self;
for (c = f->ctlslot->dev->ctl_list; c != NULL; c = c->next) {
if ((c->val_mask & mask) == 0)
continue;