git: 53c768e6836a - main - mixer(3): Do not hardcode "/dev/mixer"

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Mon, 12 Feb 2024 11:00:24 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=53c768e6836a32c8dcd0b0b422a169ef7a82a3ab

commit 53c768e6836a32c8dcd0b0b422a169ef7a82a3ab
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2024-02-12 10:59:32 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2024-02-12 11:00:05 +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
---
 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)