mirror of
https://github.com/openbsd/src.git
synced 2026-04-27 15:46:02 +00:00
Use /dev/audioctlN instead of /dev/mixerN.
/dev/audioctlN files are opened in O_WRONLY mode because mixerctl(2) doesn't need to read them. tweaks and ok mestre and kn
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: mixerctl.conf.5,v 1.8 2020/02/10 13:18:20 schwarze Exp $
|
||||
.\" $OpenBSD: mixerctl.conf.5,v 1.9 2020/04/04 08:43:08 ratchov Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2008 Jason McIntyre <jmc@openbsd.org>
|
||||
.\"
|
||||
@@ -14,7 +14,7 @@
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: February 10 2020 $
|
||||
.Dd $Mdocdate: April 4 2020 $
|
||||
.Dt MIXERCTL.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -135,7 +135,7 @@ The file can then be played back to determine quality.
|
||||
.Dl $ aucat -o test.wav
|
||||
.Sh FILES
|
||||
.Bl -tag -width /etc/examples/mixerctl.conf -compact
|
||||
.It Pa /dev/mixer0
|
||||
.It Pa /dev/audioctl0
|
||||
Default audio mixing device.
|
||||
.It Pa /etc/mixerctl.conf
|
||||
.Xr mixerctl 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: mixerctl.1,v 1.35 2018/07/30 17:24:25 jmc Exp $
|
||||
.\" $OpenBSD: mixerctl.1,v 1.36 2020/04/04 08:43:08 ratchov Exp $
|
||||
.\" $NetBSD: mixerctl.1,v 1.8 1998/05/09 12:41:16 augustss Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
@@ -27,7 +27,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: July 30 2018 $
|
||||
.Dd $Mdocdate: April 4 2020 $
|
||||
.Dt MIXERCTL 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -68,7 +68,7 @@ This is the default, if no parameters are given to
|
||||
.It Fl f Ar file
|
||||
Specify an alternative audio mixing device.
|
||||
The default is
|
||||
.Pa /dev/mixer0 .
|
||||
.Pa /dev/audioctl0 .
|
||||
.It Fl n
|
||||
Suppress printing of the variable name.
|
||||
.It Fl q
|
||||
@@ -153,7 +153,7 @@ The audio mixer device to use.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width "/etc/mixerctl.confXXX" -compact
|
||||
.It Pa /dev/mixer0
|
||||
.It Pa /dev/audioctl0
|
||||
Default mixer audio device.
|
||||
.It Pa /etc/mixerctl.conf
|
||||
.Nm
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: mixerctl.c,v 1.32 2019/06/28 13:35:02 deraadt Exp $ */
|
||||
/* $OpenBSD: mixerctl.c,v 1.33 2020/04/04 08:43:08 ratchov Exp $ */
|
||||
/* $NetBSD: mixerctl.c,v 1.11 1998/04/27 16:55:23 augustss Exp $ */
|
||||
|
||||
/*
|
||||
@@ -249,7 +249,7 @@ main(int argc, char **argv)
|
||||
int ndev;
|
||||
|
||||
if ((file = getenv("MIXERDEVICE")) == 0 || *file == '\0')
|
||||
file = "/dev/mixer";
|
||||
file = "/dev/audioctl0";
|
||||
|
||||
while ((ch = getopt(argc, argv, "af:nqtvw")) != -1) {
|
||||
switch (ch) {
|
||||
@@ -284,20 +284,15 @@ main(int argc, char **argv)
|
||||
if (argc == 0 && tflag == 0)
|
||||
aflag = 1;
|
||||
|
||||
if (unveil(file, "rw") == -1)
|
||||
if (unveil(file, "w") == -1)
|
||||
err(1, "unveil");
|
||||
|
||||
if ((fd = open(file, O_RDWR)) == -1) {
|
||||
if (unveil(file, "r") == -1)
|
||||
err(1, "unveil");
|
||||
|
||||
if ((fd = open(file, O_RDONLY)) == -1)
|
||||
err(1, "%s", file);
|
||||
}
|
||||
|
||||
if (unveil(NULL, NULL) == -1)
|
||||
err(1, "unveil");
|
||||
|
||||
if ((fd = open(file, O_WRONLY)) == -1)
|
||||
err(1, "%s", file);
|
||||
|
||||
for (ndev = 0; ; ndev++) {
|
||||
dinfo.index = ndev;
|
||||
if (ioctl(fd, AUDIO_MIXER_DEVINFO, &dinfo) == -1)
|
||||
|
||||
Reference in New Issue
Block a user