summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprovos <provos@openbsd.org>1998-04-30 13:46:16 +0000
committerprovos <provos@openbsd.org>1998-04-30 13:46:16 +0000
commit9b096ac97a4209f04941a1381f695b97584ae288 (patch)
treecec63a57b1badc8c1273443d35e0cc52b6185d6b
parentFrom NetBSD: Lennart Augustsson: (diff)
downloadwireguard-openbsd-9b096ac97a4209f04941a1381f695b97584ae288.tar.xz
wireguard-openbsd-9b096ac97a4209f04941a1381f695b97584ae288.zip
From NetBSD: Lennart Augustsson
environment variable for default audioctl device
-rw-r--r--usr.bin/audioctl/audioctl.110
-rw-r--r--usr.bin/audioctl/audioctl.c11
2 files changed, 15 insertions, 6 deletions
diff --git a/usr.bin/audioctl/audioctl.1 b/usr.bin/audioctl/audioctl.1
index 8be9b6c57d7..8b2e180bf59 100644
--- a/usr.bin/audioctl/audioctl.1
+++ b/usr.bin/audioctl/audioctl.1
@@ -1,5 +1,5 @@
-.\" $OpenBSD: audioctl.1,v 1.3 1998/04/26 22:27:24 provos Exp $
-.\" $NetBSD: audioctl.1,v 1.5 1997/10/18 12:05:22 lukem Exp $
+.\" $OpenBSD: audioctl.1,v 1.4 1998/04/30 13:46:16 provos Exp $
+.\" $NetBSD: audioctl.1,v 1.7 1998/04/27 16:55:23 augustss Exp $
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
@@ -93,8 +93,12 @@ or
.Sh FILES
.Bl -tag -width /dev/audioctl
.It Pa /dev/audioctl
-audio device
+audio control device
.El
+.Sh ENVIRONMENT
+.Bl -tag -width AUDIOCTLDEVICE
+.It Pa AUDIOCTLDEVICE
+the audio control device to use.
.Sh SEE ALSO
.Xr mixerctl 1 ,
.Xr audio 4 ,
diff --git a/usr.bin/audioctl/audioctl.c b/usr.bin/audioctl/audioctl.c
index 7a007ad65ff..957fe955afe 100644
--- a/usr.bin/audioctl/audioctl.c
+++ b/usr.bin/audioctl/audioctl.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: audioctl.c,v 1.2 1998/04/26 22:27:25 provos Exp $ */
-/* $NetBSD: audioctl.c,v 1.12 1997/10/19 07:44:12 augustss Exp $ */
+/* $OpenBSD: audioctl.c,v 1.3 1998/04/30 13:46:18 provos Exp $ */
+/* $NetBSD: audioctl.c,v 1.14 1998/04/27 16:55:23 augustss Exp $ */
/*
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -37,6 +37,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
@@ -335,9 +336,13 @@ main(argc, argv)
int fd, i, ch;
int aflag = 0, wflag = 0;
struct stat dstat, ostat;
- char *file = "/dev/audioctl";
+ char *file;
char *sep = "=";
+ file = getenv("AUDIOCTLDEVICE");
+ if (file == 0)
+ file = "/dev/audioctl";
+
prog = *argv;
while ((ch = getopt(argc, argv, "af:nw")) != -1) {