Page MenuHomeFreeBSD

mixer(8): Report an error if passed value is an empty string
ClosedPublic

Authored by 0mp on Aug 24 2019, 10:47 PM.

Details

Summary
mixer(8): Report an error if 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
Test Plan
$ sudo mkdir -p /usr/tests/usr.sbin/mixer/
$ cd src/usr.sbin/mixer
$ make && sudo make install && (cd /usr/tests/usr.sbin/mixer/ && kyua test)

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

0mp created this revision.Aug 24 2019, 10:47 PM
0mp updated this revision to Diff 61247.Aug 24 2019, 10:51 PM

Fix a typo in an atf_test description

0mp added reviewers: mav, ed.Aug 24 2019, 11:38 PM
mav accepted this revision.Aug 25 2019, 1:37 AM

Looks good to me. Just thinking whether -1 or EOF is more appropriate.

This revision is now accepted and ready to land.Aug 25 2019, 1:37 AM
hselasky accepted this revision.Aug 25 2019, 2:43 PM
0mp added a comment.Aug 25 2019, 3:00 PM
In D21409#465784, @mav wrote:

Looks good to me. Just thinking whether -1 or EOF is more appropriate.

Probably EOF. I'll change it in the final commit.

Also, do we want to MFC this change?

mav added a comment.Aug 25 2019, 3:11 PM
In D21409#465864, @0mp wrote:

Also, do we want to MFC this change?

Probably. Why not.

This revision was automatically updated to reflect the committed changes.