svn commit: r358955 - in stable/12: etc/mtree usr.sbin/mixer usr.sbin/mixer/tests
Mateusz Piotrowski
0mp at FreeBSD.org
Fri Mar 13 11:27:30 UTC 2020
Author: 0mp (doc,ports committer)
Date: Fri Mar 13 11:27:29 2020
New Revision: 358955
URL: https://svnweb.freebsd.org/changeset/base/358955
Log:
MFC 351481, 357619:
Approved by: bcr (mentor), hselasky (src)
Differential Revision: https://reviews.freebsd.org/D24058
mixer(8): Report an error if the passed value is an empty string
This patch fixes a bug that made the mixer command enter
an infinite loop when instructed to set the value of a device
to an empty string (e.g., `mixer vol ""`).
Additionally, some tests for mixer(8) are being added.
PR: 240039
Reviewed by: hselasky, mav
Approved by: src (hselasky, mav)
Differential Revision: https://reviews.freebsd.org/D21409
mixer: call the cleanup function in a test
The set_empty_value test has a cleanup function, but is not called.
Fix it
Reviewed by: 0mp
Approved by: kp
Differential Revision: https://reviews.freebsd.org/D23498
Added:
stable/12/usr.sbin/mixer/tests/
- copied from r351481, head/usr.sbin/mixer/tests/
Modified:
stable/12/etc/mtree/BSD.tests.dist
stable/12/usr.sbin/mixer/Makefile
stable/12/usr.sbin/mixer/mixer.c
stable/12/usr.sbin/mixer/tests/mixer_test.sh
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/etc/mtree/BSD.tests.dist
==============================================================================
--- stable/12/etc/mtree/BSD.tests.dist Fri Mar 13 11:07:48 2020 (r358954)
+++ stable/12/etc/mtree/BSD.tests.dist Fri Mar 13 11:27:29 2020 (r358955)
@@ -817,6 +817,8 @@
..
link
..
+ mixer
+ ..
mkdir
..
mkfifo
Modified: stable/12/usr.sbin/mixer/Makefile
==============================================================================
--- stable/12/usr.sbin/mixer/Makefile Fri Mar 13 11:07:48 2020 (r358954)
+++ stable/12/usr.sbin/mixer/Makefile Fri Mar 13 11:27:29 2020 (r358955)
@@ -1,6 +1,11 @@
# $FreeBSD$
+.include <src.opts.mk>
+
PROG= mixer
MAN= mixer.8
+
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
.include <bsd.prog.mk>
Modified: stable/12/usr.sbin/mixer/mixer.c
==============================================================================
--- stable/12/usr.sbin/mixer/mixer.c Fri Mar 13 11:07:48 2020 (r358954)
+++ stable/12/usr.sbin/mixer/mixer.c Fri Mar 13 11:27:29 2020 (r358955)
@@ -241,6 +241,11 @@ main(int argc, char *argv[])
lrel = rrel = 0;
if (argc > 1) {
m = sscanf(argv[1], "%7[^:]:%7s", lstr, rstr);
+ if (m == EOF) {
+ warnx("invalid value: %s", argv[1]);
+ dusage = 1;
+ break;
+ }
if (m > 0) {
if (*lstr == '+' || *lstr == '-')
lrel = rrel = 1;
Modified: stable/12/usr.sbin/mixer/tests/mixer_test.sh
==============================================================================
--- head/usr.sbin/mixer/tests/mixer_test.sh Sun Aug 25 17:55:31 2019 (r351481)
+++ stable/12/usr.sbin/mixer/tests/mixer_test.sh Fri Mar 13 11:27:29 2020 (r358955)
@@ -93,7 +93,7 @@ S_flag_cleanup()
restore_mixer_vol
}
-atf_test_case set_empty_value
+atf_test_case set_empty_value cleanup
set_empty_value_head()
{
atf_set "descr" "Verify that mixer returns when the provided " \
More information about the svn-src-stable
mailing list