windows: Translate ERROR_DEVICE_NOT_CONNECTED to LIBUSB_TRANSFER_NO_DEVICE
authorMatthias Bolte <matthias@tinkerforge.com>
Fri, 13 Dec 2019 17:05:08 +0000 (18:05 +0100)
committerChris Dickens <christopher.a.dickens@gmail.com>
Fri, 3 Jan 2020 02:54:59 +0000 (18:54 -0800)
Windows 7 reports error code ERROR_DEVICE_NOT_CONNECTED if transters fail
due to unplugging the device.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/windows_nt_common.c
libusb/version_nano.h

index 54338a7..9c584fe 100644 (file)
@@ -563,6 +563,7 @@ static void windows_transfer_callback(const struct windows_backend *backend,
                status = LIBUSB_TRANSFER_CANCELLED;
                break;
        case ERROR_FILE_NOT_FOUND:
+       case ERROR_DEVICE_NOT_CONNECTED:
                usbi_dbg("detected device removed");
                status = LIBUSB_TRANSFER_NO_DEVICE;
                break;
index 3b9b7ee..87f9e69 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11417
+#define LIBUSB_NANO 11418