From 6766fad3d51a176dad50698a1b94c460ffd28578 Mon Sep 17 00:00:00 2001 From: Lars Hanisch Date: Thu, 8 Dec 2011 00:07:19 +0100 Subject: fix a possible double attach of devices if they have a cardindex set with udev --- dynamicdevice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dynamicdevice.c') diff --git a/dynamicdevice.c b/dynamicdevice.c index 7327f55..1758cf7 100644 --- a/dynamicdevice.c +++ b/dynamicdevice.c @@ -26,7 +26,7 @@ int cDynamicDevice::IndexOf(const char *DevPath, int &NextFreeIndex, int WishInd isyslog("dynamite: device at slot %d has cardindex %d", i + 1, dynamicdevice[i]->CardIndex()); if ((NextFreeIndex < 0) || ((WishIndex >= 0) && (dynamicdevice[i]->CardIndex() == WishIndex))) { NextFreeIndex = i; - if (dynamicdevice[i]->CardIndex() == WishIndex) + if ((dynamicdevice[i]->CardIndex() == WishIndex) && (index >= 0)) break; } } -- cgit v1.2.3