From ad49de77401c9136e17858ff4d194935918988e1 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 1 Mar 2015 12:54:41 +0100 Subject: [PATCH] =?UTF-8?q?GC=20Adapter:=20don=E2=80=99t=20stop=20scanning?= =?UTF-8?q?=20after=20failing=20to=20claim=20an=20adapter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only call Shutdown() after all devices have been tested. --- Source/Core/Core/HW/SI_GCAdapter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/HW/SI_GCAdapter.cpp b/Source/Core/Core/HW/SI_GCAdapter.cpp index 7354abd55a..324e64a890 100644 --- a/Source/Core/Core/HW/SI_GCAdapter.cpp +++ b/Source/Core/Core/HW/SI_GCAdapter.cpp @@ -143,14 +143,12 @@ void Setup() if (ret == LIBUSB_ERROR_NOT_SUPPORTED) s_libusb_driver_not_supported = true; } - Shutdown(); } else if ((ret = libusb_kernel_driver_active(s_handle, 0)) == 1) { if ((ret = libusb_detach_kernel_driver(s_handle, 0)) && ret != LIBUSB_ERROR_NOT_SUPPORTED) { ERROR_LOG(SERIALINTERFACE, "libusb_detach_kernel_driver failed with error: %d", ret); - Shutdown(); } else { @@ -161,12 +159,10 @@ void Setup() else if ((ret != 0 && ret != LIBUSB_ERROR_NOT_SUPPORTED)) { ERROR_LOG(SERIALINTERFACE, "libusb_kernel_driver_active error ret = %d", ret); - Shutdown(); } else if ((ret = libusb_claim_interface(s_handle, 0))) { ERROR_LOG(SERIALINTERFACE, "libusb_claim_interface failed with error: %d", ret); - Shutdown(); } else { @@ -175,6 +171,8 @@ void Setup() } } } + if (!s_detected) + Shutdown(); libusb_free_device_list(list, 1); }