From 95096bd8781e86b456a076e1d90a865eeaca788e Mon Sep 17 00:00:00 2001 From: ratchov Date: Fri, 24 May 2024 15:01:53 +0000 Subject: [PATCH] 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. --- usr.bin/sndiod/dev.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 * @@ -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: -- 2.20.1