OpenBSD CVS

CVS log for src/usr.bin/mixerctl/mixerctl.c


[BACK] Up to [local] / src / usr.bin / mixerctl

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.34 / (download) - annotate - [select for diffs], Mon Jul 12 15:09:20 2021 UTC (2 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, HEAD
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@

Revision 1.33 / (download) - annotate - [select for diffs], Sat Apr 4 08:43:08 2020 UTC (4 years, 1 month ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.32: +6 -11 lines
Diff to previous 1.32 (colored)

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

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:02 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.31: +7 -7 lines
Diff to previous 1.31 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.31 / (download) - annotate - [select for diffs], Wed Aug 8 19:35:47 2018 UTC (5 years, 9 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.30: +13 -3 lines
Diff to previous 1.30 (colored)

add unveil(2) to mixerctl(1)

after we know what is the mixer device to be used, either through MIXERDEVICE
env var, the argument passed or by default /dev/mixer then we can unveil it in
read/write mode, then if opening fails we reduce unveil to only read mode.

Once open(2) succeeds then we can disable fs access by calling unveil(NULL, NULL)
since all further operations occur on fds.

A cleaner solution would be to just call pledge("audio") after open(2) but
currently the ioctls used are not whitelisted in pledge(2), ratchov@ will
investigate a better way to do this

OK ratchov@

Revision 1.30 / (download) - annotate - [select for diffs], Sun Feb 8 23:40:34 2015 UTC (9 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.29: +4 -4 lines
Diff to previous 1.29 (colored)

in getopt() blocks, stop incrementing flag variable which are supposed
to just be 0/1
ok miod florian

Revision 1.29 / (download) - annotate - [select for diffs], Thu Nov 12 07:27:31 2009 UTC (14 years, 6 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.28: +13 -14 lines
Diff to previous 1.28 (colored)

if a value is changed and -n is used, print the new value only.
from Pawlowski Marcin Piotr <pmp.openbsd at gmail.com>
ok jakemsr

Revision 1.28 / (download) - annotate - [select for diffs], Thu Jun 26 05:42:21 2008 UTC (15 years, 10 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.27: +1 -8 lines
Diff to previous 1.27 (colored)

First pass at removing clauses 3 and 4 from NetBSD licenses.

Not sure what's more surprising: how long it took for NetBSD to
catch up to the rest of the BSDs (including UCB), or the amount of
code that NetBSD has claimed for itself without attributing to the
actual authors.

OK deraadt@

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 13 21:26:01 2008 UTC (16 years, 4 months ago) by ratchov
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.26: +2 -3 lines
Diff to previous 1.26 (colored)

the mixer_devinfo structure contains next and prev pointers; they are used
to create doubly linked "chains" of mixer devices. Currently mixerctl(1)
supposes that the 'next' index is never smaller than the index of the
device; so it fails to handle such mixers. The fix, allows 'next' indexes to
be smaller than the index of the device.

ok jakemsr@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Nov 26 13:36:34 2007 UTC (16 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.25: +5 -3 lines
Diff to previous 1.25 (colored)

if no arguments given, assume a nice default; ok miod jakemsr deanna

Revision 1.25 / (download) - annotate - [select for diffs], Thu Sep 27 21:55:54 2007 UTC (16 years, 7 months ago) by sobrado
Branch: MAIN
Changes since 1.24: +3 -3 lines
Diff to previous 1.24 (colored)

style(9) fixes, optional flags without arguments come first;
while here, some spacing fixes

ok deanna@, jakemsr@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Aug 6 19:16:06 2007 UTC (16 years, 9 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

the ellipsis is not an optional argument; while here, sync the usage
and synopsis of commands

lots of good ideas by jmc@

ok jmc@

Revision 1.23 / (download) - annotate - [select for diffs], Fri Oct 7 17:08:36 2005 UTC (18 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

missing progname, clamat@telus.net

Revision 1.22 / (download) - annotate - [select for diffs], Sat Oct 1 17:07:26 2005 UTC (18 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.21: +26 -8 lines
Diff to previous 1.21 (colored)

toggle support from janus@area319.de.  i was unsure, but a few other
people found this very useful

Revision 1.21 / (download) - annotate - [select for diffs], Mon May 9 13:23:35 2005 UTC (19 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.20: +5 -5 lines
Diff to previous 1.20 (colored)

Fix mixerctl -q

Revision 1.20 / (download) - annotate - [select for diffs], Mon Feb 7 14:29:10 2005 UTC (19 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.19: +41 -51 lines
Diff to previous 1.19 (colored)

Levels should be between AUDIO_MIN_GAIN and AUDIO_MAX_GAIN inclusive
Truncate specified level to be within this range and avoid wrapping.
Idea from espie@, OK henning@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Feb 2 08:08:33 2005 UTC (19 years, 3 months ago) by otto
Branch: MAIN
Changes since 1.18: +86 -88 lines
Diff to previous 1.18 (colored)

Fix a few memory leaks and general cleanup. From Joris Vink. ok tedu@

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jan 4 18:22:09 2005 UTC (19 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.17: +16 -16 lines
Diff to previous 1.17 (colored)

Minor KNF, s/for(/for (/

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jan 4 18:20:37 2005 UTC (19 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.16: +6 -5 lines
Diff to previous 1.16 (colored)

Fix some issues noted by Joris Vink; pedro@ OK
o g/c the changed field in struct field
o increment argv for bad fields too
o deal with AUDIO_MIXER_DEVINFO (unlikely) failures

Revision 1.16 / (download) - annotate - [select for diffs], Tue Mar 2 23:09:27 2004 UTC (20 years, 2 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.15: +4 -4 lines
Diff to previous 1.15 (colored)

fix ndev counting loop.  report from Stuart Cassoff

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jan 22 17:44:54 2004 UTC (20 years, 4 months ago) by vincent
Branch: MAIN
Changes since 1.14: +8 -4 lines
Diff to previous 1.14 (colored)

fix segfault when an invalid field was requested

ok miod

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jan 22 08:06:18 2004 UTC (20 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.13: +37 -43 lines
Diff to previous 1.13 (colored)

remove need for -w. ok beck deraadt

Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 21 10:20:06 2003 UTC (20 years, 6 months ago) by jmc
Branch: MAIN
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored)

mixerctl.1:
- put SYNOPSIS in standard form
- -n does not make sense with -q
- adjust -width of option list
- sort options
- a clarity fix from snj att pobox dott com

mixerctl.c:
- fix spacing in usage()
- sync usage() with SYNOPSIS

Revision 1.12 / (download) - annotate - [select for diffs], Thu May 15 09:30:06 2003 UTC (21 years ago) by todd
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

unbreak tree; ok margarida@

Revision 1.11 / (download) - annotate - [select for diffs], Thu May 15 04:16:57 2003 UTC (21 years ago) by jsyn
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

make usage printing match what's in the manpage, which is better; ok jfb@

Revision 1.10 / (download) - annotate - [select for diffs], Thu May 15 00:57:50 2003 UTC (21 years ago) by jfb
Branch: MAIN
Changes since 1.9: +9 -6 lines
Diff to previous 1.9 (colored)

Add a -q flag to suppress all output when setting a variable, and
remove the -v flag from the SYNOPSIS for the -w option since it
has no effect

ok jsyn@ millert@

Revision 1.9 / (download) - annotate - [select for diffs], Tue Dec 3 22:27:42 2002 UTC (21 years, 5 months ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.8: +62 -72 lines
Diff to previous 1.8 (colored)

ansify, indent, check for malloc/calloc failure, proper usage()
from andrushock@korovino.net via deraadt

Revision 1.8 / (download) - annotate - [select for diffs], Wed May 29 18:33:39 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.7: +9 -5 lines
Diff to previous 1.7 (colored)

strlcat

Revision 1.7 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:49 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.6: +5 -5 lines
Diff to previous 1.6 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Jan 9 18:12:24 2002 UTC (22 years, 4 months ago) by mickey
Branch: MAIN
Changes since 1.5: +11 -11 lines
Diff to previous 1.5 (colored)

open RDWR only for -w, RDONLY otherwise

Revision 1.5 / (download) - annotate - [select for diffs], Mon Jul 19 20:54:21 1999 UTC (24 years, 10 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.4: +5 -1 lines
Diff to previous 1.4 (colored)

fix for case no mixer devices are available, got triggered by malloc.conf->J; millert@ ok

Revision 1.4 / (download) - annotate - [select for diffs], Sat May 2 22:28:07 1998 UTC (26 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.3: +41 -6 lines
Diff to previous 1.3 (colored)

allow relative values via +/- prefixes

Revision 1.3 / (download) - annotate - [select for diffs], Thu Apr 30 13:40:01 1998 UTC (26 years ago) by provos
Branch: MAIN
Changes since 1.2: +7 -3 lines
Diff to previous 1.2 (colored)

From NetBSD: Lennart Augustsson:
environment variable for default mixer device

Revision 1.2 / (download) - annotate - [select for diffs], Sun Apr 26 22:27:30 1998 UTC (26 years ago) by provos
Branch: MAIN
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

$OpenBSD$

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sun Apr 26 21:45:35 1998 UTC (26 years ago) by provos
Branch: MIXERCTL
CVS Tags: MIXERCTL10
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

mixerctl from NetBSD, mostly by Lennart Augustsson <augustss@cs.chalmers.se>

Revision 1.1 / (download) - annotate - [select for diffs], Sun Apr 26 21:45:35 1998 UTC (26 years ago) by provos
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.