Module Name: src Committed By: kre Date: Thu Feb 23 14:09:11 UTC 2017
Modified Files: src/usr.bin/mixerctl: mixerctl.c Log Message: Generate usage error for bad usage, before attempting any other operations. This means that "mixerctl" (no args) will generate a usage msg, even when /dev/mixer cannot be opened (or any other device given via -d or $MIXERDEVICE) While here, get rid of "goto usage" replacing the usage: with a static inline void __dead function... The compiler ought to optimise the calls into essentially the same code as existed with the goto version, but this is much cleaner. Also, mixerctl falls back on /dev/mixer0 if /dev/mixer cannot be opened. (that is old code - probably from when /dev/mixer was first added) It used to do that when called as mixerctl -d /dev/mixer or with "MIXERDEVICE=/dev/mixer mixerctl...". No longer. Now the fallback (which is probably obsolete now anyway) only happens when the user doesn't specify any mixer device (by either method) and the default of /dev/mixer is used. In other cases, only the device specified is tried. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.bin/mixerctl/mixerctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.