errno is not used with libusb1, use the return code

for timeout detection


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14718 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2014-01-19 17:10:59 +00:00
parent bf7f055a4a
commit 9583c27ab9

View File

@@ -508,7 +508,7 @@ gp_port_usb_check_int (GPPort *port, char *bytes, int size, int timeout)
ret = libusb_interrupt_transfer (port->pl->dh, port->settings.usb.intep,
(unsigned char*)bytes, size, &curread, timeout);
if (ret < 0) {
if ((errno == EAGAIN) || (errno == ETIMEDOUT))
if (ret == LIBUSB_TRANSFER_TIMED_OUT)
return GP_ERROR_TIMEOUT;
return GP_ERROR_IO_READ;
}