summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2024-05-24 15:01:54 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2024-05-24 15:01:54 +0000
commit1b199d09996172f22d91a50d591864c7cb27a208 (patch)
tree907a0f951f9aa045b620197cebabe5822450b5bf /usr.bin/sndiod
parentfa42565da3df31aecb5c76d7ca3402e6458e7952 (diff)
sndiod: Hide "hardware" device's server.device control.
If sndiod is using another sndiod instance instead of the bare hardware, then it must disable the underlying server.device control to avoid conflicts with its own server.device control.
Diffstat (limited to 'usr.bin/sndiod')
-rw-r--r--usr.bin/sndiod/dev.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c
index a5fc85e74eb..eaa29fbf922 100644
--- a/usr.bin/sndiod/dev.c
+++ b/usr.bin/sndiod/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.113 2024/05/06 05:37:26 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.114 2024/05/24 15:01:53 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -2290,6 +2290,14 @@ ctlslot_visible(struct ctlslot *s, struct ctl *c)
return 1;
switch (c->scope) {
case CTL_HW:
+ /*
+ * Disable hardware's server.device control as its
+ * replaced by sndiod's one
+ */
+ if (strcmp(c->node0.name, "server") == 0 &&
+ strcmp(c->func, "device") == 0)
+ return 0;
+ /* FALLTHROUHG */
case CTL_DEV_MASTER:
return (s->opt->dev == c->u.any.arg0);
case CTL_OPT_DEV: