]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r353009: libusb: LIBUSB_DEBUG env var override of libusb_set_debug
authorKyle Evans <kevans@FreeBSD.org>
Sun, 6 Oct 2019 03:59:05 +0000 (03:59 +0000)
committerKyle Evans <kevans@FreeBSD.org>
Sun, 6 Oct 2019 03:59:05 +0000 (03:59 +0000)
commit70ace4add0d9a982ff5b66d71a63a456f2f86f09
tree0175eb96fa0dc77a4e3dc02bbd136cc311e48ec0
parent8cf12587cf52e70938e308e61061830b4859a258
MFC r353009: libusb: LIBUSB_DEBUG env var override of libusb_set_debug

The debug level generally just controls verbosity of libusb for debugging
libusb devices/usage. We allow the environment to set the debug level
independent of the application, but the application will always override
this if it explicitly sets the debug level.

Changing the environment is easy, but patching the software to change the
debug level isn't necessarily easy or possible. Further, there's this
write-only debug_fixed variable that would seem to imply that the debug
level should be fixed, but it isn't currently used. Change the logic to use
strtol() so we can detect real 0 vs. conversion failure, then honor
debug_fixed in libusb_set_debug.
lib/libusb/libusb10.c