mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-12 10:37:02 +00:00
nsyshid/libusb: Don't attempt kernel driver detach on MacOS (#1736)
This commit is contained in:
parent
85c8f95b69
commit
bb3fb81fb6
1 changed files with 21 additions and 17 deletions
|
|
@ -763,6 +763,9 @@ namespace nsyshid::backend::libusb
|
||||||
int DeviceLibusb::ClaimAllInterfaces(uint8 config_num)
|
int DeviceLibusb::ClaimAllInterfaces(uint8 config_num)
|
||||||
{
|
{
|
||||||
const int ret = DoForEachInterface(m_config_descriptors, config_num, [this](uint8 i) {
|
const int ret = DoForEachInterface(m_config_descriptors, config_num, [this](uint8 i) {
|
||||||
|
// On macos detaching would fail without root or entitlement.
|
||||||
|
// We assume user is using GCAdapterDriver and therefore don't want to detach anything
|
||||||
|
#if !defined(__APPLE__)
|
||||||
if (libusb_kernel_driver_active(this->m_libusbHandle, i))
|
if (libusb_kernel_driver_active(this->m_libusbHandle, i))
|
||||||
{
|
{
|
||||||
const int ret2 = libusb_detach_kernel_driver(this->m_libusbHandle, i);
|
const int ret2 = libusb_detach_kernel_driver(this->m_libusbHandle, i);
|
||||||
|
|
@ -773,6 +776,7 @@ namespace nsyshid::backend::libusb
|
||||||
return ret2;
|
return ret2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return libusb_claim_interface(this->m_libusbHandle, i);
|
return libusb_claim_interface(this->m_libusbHandle, i);
|
||||||
});
|
});
|
||||||
if (ret < LIBUSB_SUCCESS)
|
if (ret < LIBUSB_SUCCESS)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue