Changeset 1164 for trunk/src


Ignore:
Timestamp:
08/18/09 08:21:19 (3 years ago)
Author:
aj
Message:

Apply fix by Emmanuel Dreyfus (Enhanced to limit the loop to 5 tries)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ifd/sys-bsd.c

    r1138 r1164  
    318318#else 
    319319        struct usb_ctl_request ctrl; 
     320        int retries; 
    320321 
    321322        ifd_debug(1, "BSD: ifd_sysdep_usb_control(0x%x)", request); 
     
    345346        } 
    346347 
    347         if ((rc = ioctl(dev->fd, USB_DO_REQUEST, &ctrl)) < 0) { 
     348        retries = 5; 
     349        while ((rc = ioctl(dev->fd, USB_DO_REQUEST, &ctrl)) < 0 && retries > 0) { 
    348350                ifd_debug(1, "USB_DO_REQUEST failed: %d", rc); 
    349351                ct_error("usb_do_request failed: %s (%d)", 
    350352                         strerror(errno), errno); 
    351                 return IFD_ERROR_COMM_ERROR; 
     353                retries--; 
    352354        } 
    353355 
Note: See TracChangeset for help on using the changeset viewer.