Changeset View
Changeset View
Standalone View
Standalone View
devel/libgusb/files/patch-gusb_gusb-context.c
- This file was added.
--- gusb/gusb-context.c.orig 2021-03-12 16:08:58 UTC | |||||
+++ gusb/gusb-context.c | |||||
@@ -444,6 +444,7 @@ g_usb_context_rescan (GUsbContext *context) | |||||
libusb_free_device_list (dev_list, 1); | |||||
} | |||||
+#ifndef __FreeBSD__ | |||||
static gboolean | |||||
g_usb_context_rescan_cb (gpointer user_data) | |||||
{ | |||||
@@ -451,6 +452,7 @@ g_usb_context_rescan_cb (gpointer user_data) | |||||
g_usb_context_rescan (context); | |||||
return TRUE; | |||||
} | |||||
+#endif | |||||
/** | |||||
@@ -516,12 +518,14 @@ g_usb_context_enumerate (GUsbContext *context) | |||||
return; | |||||
g_usb_context_rescan (context); | |||||
+#ifndef __FreeBSD__ | |||||
if (!libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) { | |||||
g_debug ("platform does not do hotplug, using polling"); | |||||
priv->hotplug_poll_id = g_timeout_add_seconds (1, | |||||
g_usb_context_rescan_cb, | |||||
context); | |||||
} | |||||
+#endif | |||||
priv->done_enumerate = TRUE; | |||||
} | |||||
@@ -616,7 +620,9 @@ g_usb_context_initable_init (GInitable *initable, | |||||
context); | |||||
/* watch for add/remove */ | |||||
+#ifndef __FreeBSD__ | |||||
if (libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) { | |||||
+#endif | |||||
rc = libusb_hotplug_register_callback (priv->ctx, | |||||
LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | | |||||
LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT, | |||||
@@ -631,7 +637,9 @@ g_usb_context_initable_init (GInitable *initable, | |||||
g_warning ("Error creating a hotplug callback: %s", | |||||
g_usb_strerror (rc)); | |||||
} | |||||
+#ifndef __FreeBSD__ | |||||
} | |||||
+#endif | |||||
return TRUE; | |||||
} |