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)
Sat, Apr 27, 8:49 AM
Unknown Object (File)
Sat, Apr 27, 8:00 AM
Unknown Object (File)
Sat, Apr 27, 8:00 AM
Unknown Object (File)
Sat, Apr 27, 8:00 AM
Unknown Object (File)
Sat, Apr 27, 8:00 AM
Unknown Object (File)
Sat, Apr 27, 6:20 AM
Unknown Object (File)
Fri, Apr 5, 3:17 PM
Unknown Object (File)
Fri, Apr 5, 3:17 PM
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.