|
Added
Link Here
|
| 1 |
FreeBSD's libusb does not have libusb_set_option. |
| 2 |
Just skip the adjusting of libusb log level to avoid |
| 3 |
a build error. |
| 4 |
|
| 5 |
The way to adjust the FreeBSD libusb log level is via passing options |
| 6 |
to usb_init_context(3) or with the LIBUSB_DEBUG environment variable |
| 7 |
- also read by usb_init_context(3). |
| 8 |
|
| 9 |
But that's more invasive patching for little benefit here. |
| 10 |
|
| 11 |
--- tools/usbredirect.c.orig 2021-04-02 15:42:05 UTC |
| 12 |
+++ tools/usbredirect.c |
| 13 |
@@ -528,11 +528,15 @@ main(int argc, char *argv[]) |
| 14 |
/* Only allow libusb logging if log verbosity is uredirparser_debug_data |
| 15 |
* (or higher), otherwise we disable it here while keeping usbredir's logs enable. */ |
| 16 |
if (self->verbosity < usbredirparser_debug_data) { |
| 17 |
+#if 0 |
| 18 |
int ret = libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, LIBUSB_LOG_LEVEL_NONE); |
| 19 |
if (ret != LIBUSB_SUCCESS) { |
| 20 |
g_warning("error disabling libusb log level: %s", libusb_error_name(ret)); |
| 21 |
goto end; |
| 22 |
} |
| 23 |
+#else |
| 24 |
+ g_warning("libusb_set_option not available, so not reducing libusb log level based on usbredirect level (%d)", self->verbosity); |
| 25 |
+#endif |
| 26 |
} |
| 27 |
|
| 28 |
if (self->is_client) { |