summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-02-11 20:29:58 +0100
committerHans de Goede <hdegoede@redhat.com>2013-02-12 11:53:17 +0100
commitb5452c877ae96679c425ab97dff394b2840b6e82 (patch)
tree2eebfe54a394aa406bbb4251332e9e6ac1a73be6
parentd35f58249742caf1ace0fff5bde770871fbbd676 (diff)
usb-device-manager: Fix coldplug race
It is possible for us to see a device show up twice, if it gets plugged in between us starting listening for new devices and doing "coldplug", then it will get added once from the coldplug code, and then again from from the hotplug code path. We already have code checking for this, but the check is only compiled in under Windows -> Remove the #ifdef to also catch this under Linux. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--gtk/usb-device-manager.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c
index 3f4c272..34ff37c 100644
--- a/gtk/usb-device-manager.c
+++ b/gtk/usb-device-manager.c
@@ -699,13 +699,11 @@ static void spice_usb_device_manager_add_dev(SpiceUsbDeviceManager *self,
return;
}
-#ifdef G_OS_WIN32
device = spice_usb_device_manager_find_device(self, bus, address);
if (device) {
SPICE_DEBUG("USB device at %d.%d already exists, ignored", bus, address);
return;
}
-#endif
if (priv->coldplug_list)
dev_list = priv->coldplug_list;