--- device/usb/usb_service_impl.cc.orig 2019-04-08 08:32:56 UTC +++ device/usb/usb_service_impl.cc @@ -231,8 +231,10 @@ UsbServiceImpl::UsbServiceImpl() } UsbServiceImpl::~UsbServiceImpl() { +#if !defined(OS_FREEBSD) if (hotplug_enabled_) libusb_hotplug_deregister_callback(context_->context(), hotplug_handle_); +#endif // !defined(OS_FREEBSD) } void UsbServiceImpl::GetDevices(const GetDevicesCallback& callback) { @@ -287,6 +289,7 @@ void UsbServiceImpl::OnUsbContext(scoped_refptrcontext(), static_cast(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | @@ -299,6 +302,7 @@ void UsbServiceImpl::OnUsbContext(scoped_refptrOnDisconnect(); } +#if !defined(OS_FREEBSD) // static int LIBUSB_CALL UsbServiceImpl::HotplugCallback(libusb_context* context, libusb_device* device_raw, @@ -528,6 +533,7 @@ int LIBUSB_CALL UsbServiceImpl::HotplugCallback(libusb return 0; } +#endif // !defined(OS_FREEBSD) void UsbServiceImpl::OnPlatformDeviceAdded( ScopedLibusbDeviceRef platform_device) {