git: 7e984a34c304 - stable/14 - mixer(3): Do not hardcode "/dev/mixer"

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Mon, 26 Feb 2024 23:22:49 UTC
The branch stable/14 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=7e984a34c3048404400e8dba517f14ba44078e32

commit 7e984a34c3048404400e8dba517f14ba44078e32
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2024-02-12 10:59:32 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2024-02-26 23:22:31 +0000

    mixer(3): Do not hardcode "/dev/mixer"
    
    We have BASEPATH defined.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      2 weeks
    Reviewed by:    dev_submerge.ch, markj
    Differential Revision:  https://reviews.freebsd.org/D43812
    
    (cherry picked from commit 53c768e6836a32c8dcd0b0b422a169ef7a82a3ab)
---
 lib/libmixer/mixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c
index d78ca6e0fc87..93ace1d0c69b 100644
--- a/lib/libmixer/mixer.c
+++ b/lib/libmixer/mixer.c
@@ -87,7 +87,7 @@ mixer_open(const char *name)
 dunit:
 		if ((m->unit = mixer_get_dunit()) < 0)
 			goto fail;
-		(void)snprintf(m->name, sizeof(m->name), "/dev/mixer%d", m->unit);
+		(void)snprintf(m->name, sizeof(m->name), BASEPATH "%d", m->unit);
 	}
 
 	if ((m->fd = open(m->name, O_RDWR)) < 0)