This reduces conditional code. Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- src/usb-device-manager.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 0a979210..4b126896 100644 --- a/src/usb-device-manager.c +++ b/src/usb-device-manager.c @@ -267,14 +267,6 @@ static gboolean spice_usb_device_manager_initable_init(GInitable *initable, GList *list; GList *it; -#ifndef G_OS_WIN32 - /* Initialize libusb */ - priv->context = spice_usb_backend_new(err); - if (!priv->context) { - return FALSE; - } -#endif - /* Start listening for usb devices plug / unplug */ #ifdef G_OS_WIN32 priv->udev = g_udev_client_new(); @@ -288,6 +280,12 @@ static gboolean spice_usb_device_manager_initable_init(GInitable *initable, /* Do coldplug (detection of already connected devices) */ g_udev_client_report_devices(priv->udev); #else + /* Initialize libusb */ + priv->context = spice_usb_backend_new(err); + if (!priv->context) { + return FALSE; + } + if (!spice_usb_backend_register_hotplug(priv->context, self, spice_usb_device_manager_hotplug_cb)) { return FALSE; -- 2.20.1 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel