summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod/dev.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-06-28 05:17:27 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-06-28 05:17:27 +0000
commit0ebab2c5720f71b9dbddee76d10684ae381b5627 (patch)
tree7fb60a0e0181321d7b3971bdc2bf46b14a4ec6b7 /usr.bin/sndiod/dev.c
parent58db27e992e70b8d54d506825a284186fa725843 (diff)
Add a new SIOCTL_SEL control type to select one of a predefined set of
mutually exclusive values. It's the same as SIOCTL_LIST except that exactly one list element may be selected.
Diffstat (limited to 'usr.bin/sndiod/dev.c')
-rw-r--r--usr.bin/sndiod/dev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c
index 4b02f1831e2..0866098c9d8 100644
--- a/usr.bin/sndiod/dev.c
+++ b/usr.bin/sndiod/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.73 2020/06/18 05:11:13 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.74 2020/06/28 05:17:25 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -2296,6 +2296,7 @@ ctl_log(struct ctl *c)
break;
case CTL_VEC:
case CTL_LIST:
+ case CTL_SEL:
ctl_node_log(&c->node1);
log_puts(":");
log_putu(c->curval);
@@ -2320,7 +2321,7 @@ dev_addctl(struct dev *d, char *gstr, int type, int addr,
strlcpy(c->group, gstr, CTL_NAMEMAX);
strlcpy(c->node0.name, str0, CTL_NAMEMAX);
c->node0.unit = unit0;
- if (c->type == CTL_VEC || c->type == CTL_LIST) {
+ if (c->type == CTL_VEC || c->type == CTL_LIST || c->type == CTL_SEL) {
strlcpy(c->node1.name, str1, CTL_NAMEMAX);
c->node1.unit = unit1;
} else