Page MenuHomeFreeBSD

mixer(8): Improve error messsages and warnings
ClosedPublic

Authored by christos on Feb 8 2024, 3:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 19, 1:09 PM
Unknown Object (File)
Sun, Nov 16, 1:25 AM
Unknown Object (File)
Sat, Nov 15, 11:20 PM
Unknown Object (File)
Sun, Nov 9, 10:22 PM
Unknown Object (File)
Wed, Nov 5, 12:44 AM
Unknown Object (File)
Tue, Nov 4, 6:15 PM
Unknown Object (File)
Sun, Nov 2, 8:50 AM
Unknown Object (File)
Sat, Nov 1, 2:16 AM
Subscribers

Details

Summary

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 8 2024, 4:00 PM

Just some random testing, with no pcm devices I get:

# mixer -a
mixer: mixer_get_nmixers(): No error: 0
# mixer
mixer: mixer_open((null)): No error: 0

This case could be handled with a less cryptic message.

Improve error message for mixer_get_nmixers() and mixer_open() failures.

This revision now requires review to proceed.Feb 9 2024, 8:51 PM
This revision is now accepted and ready to land.Feb 10 2024, 12:29 AM
usr.sbin/mixer/mixer.c
71

This code should set errno to 0 before calling strtol(). Otherwise a stale errno value might be left over from a previous libc call.

christos marked an inline comment as done.

Clear errno before calling strtol().

This revision now requires review to proceed.Feb 12 2024, 10:44 AM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 12 2024, 11:01 AM
This revision was automatically updated to reflect the committed changes.