git: 4f7092eeb22d - main - virtual_oss_cmd(8): Improve error messages
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Jun 2026 13:01:01 UTC
The branch main has been updated by christos:
URL: https://cgit.FreeBSD.org/src/commit/?id=4f7092eeb22d3882f54d67a35149533fef8376ca
commit 4f7092eeb22d3882f54d67a35149533fef8376ca
Author: Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-06-02 12:57:45 +0000
Commit: Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-06-02 13:00:45 +0000
virtual_oss_cmd(8): Improve error messages
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
---
usr.sbin/virtual_oss/virtual_oss_cmd/command.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/usr.sbin/virtual_oss/virtual_oss_cmd/command.c b/usr.sbin/virtual_oss/virtual_oss_cmd/command.c
index 6f1491470e54..c647c9469630 100644
--- a/usr.sbin/virtual_oss/virtual_oss_cmd/command.c
+++ b/usr.sbin/virtual_oss/virtual_oss_cmd/command.c
@@ -37,20 +37,11 @@
#include "virtual_oss.h"
-static void
-message(const char *fmt, ...)
-{
- va_list list;
-
- va_start(list, fmt);
- vfprintf(stderr, fmt, list);
- va_end(list);
-}
-
-static void
+static void __dead2
usage(void)
{
- message("Usage: virtual_oss_cmd /dev/vdsp.ctl [command line arguments to pass to virtual_oss]\n");
+ fprintf(stderr, "usage: %s <control_device> [virtual_oss(8) command "
+ "line options]\n", getprogname());
exit(EX_USAGE);
}
@@ -68,7 +59,7 @@ main(int argc, char **argv)
fd = open(argv[1], O_RDWR);
if (fd < 0)
- errx(EX_SOFTWARE, "Could not open '%s'", argv[1]);
+ err(EX_SOFTWARE, "Could not open control device: %s", argv[1]);
for (int x = 2; x != argc; x++) {
size_t tmp = strlen(argv[x]) + 1;