mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
passthrough: do not detach kernel driver on FreeBSD
libusb_detach_kernel_driver() always fails as a regular non-root user: https://lists.freebsd.org/pipermail/freebsd-usb/2016-March/014161.html
This commit is contained in:
@ -568,12 +568,16 @@ bool BluetoothReal::OpenDevice(libusb_device* device)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detaching always fails as a regular user on FreeBSD
|
||||||
|
// https://lists.freebsd.org/pipermail/freebsd-usb/2016-March/014161.html
|
||||||
|
#ifndef __FreeBSD__
|
||||||
const int result = libusb_detach_kernel_driver(m_handle, INTERFACE);
|
const int result = libusb_detach_kernel_driver(m_handle, INTERFACE);
|
||||||
if (result < 0 && result != LIBUSB_ERROR_NOT_FOUND && result != LIBUSB_ERROR_NOT_SUPPORTED)
|
if (result < 0 && result != LIBUSB_ERROR_NOT_FOUND && result != LIBUSB_ERROR_NOT_SUPPORTED)
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to detach kernel driver for BT passthrough: %s", libusb_error_name(result));
|
PanicAlertT("Failed to detach kernel driver for BT passthrough: %s", libusb_error_name(result));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (libusb_claim_interface(m_handle, INTERFACE) < 0)
|
if (libusb_claim_interface(m_handle, INTERFACE) < 0)
|
||||||
{
|
{
|
||||||
PanicAlertT("Failed to claim interface for BT passthrough");
|
PanicAlertT("Failed to claim interface for BT passthrough");
|
||||||
|
Reference in New Issue
Block a user