git: 81b3a7991543 - stable/15 - virtual_oss_cmd(8): Improve error messages
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 09 Jun 2026 10:46:54 UTC
The branch stable/15 has been updated by christos:
URL: https://cgit.FreeBSD.org/src/commit/?id=81b3a7991543e1cf2f279e474c9636f2a0ce2e6e
commit 81b3a7991543e1cf2f279e474c9636f2a0ce2e6e
Author: Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-06-02 12:57:45 +0000
Commit: Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-06-09 10:46:47 +0000
virtual_oss_cmd(8): Improve error messages
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
(cherry picked from commit 4f7092eeb22d3882f54d67a35149533fef8376ca)
---
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 64781992ddfd..99316b896e83 100644
--- a/usr.sbin/virtual_oss/virtual_oss_cmd/command.c
+++ b/usr.sbin/virtual_oss/virtual_oss_cmd/command.c
@@ -35,20 +35,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);
}
@@ -66,7 +57,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;