Changeset 1164


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)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEWS

    r1161 r1164  
    11NEWS for OpenCT -- History of user visible changes 
    22 
    3 New in 0.6.17, 2009-07-29; Andreas Jellinghaus 
     3New in 0.6.18;  
     4* USB code for BSD fixed by Emmanuel Dreyfus 
     5 
     6New in 0.6.17; 2009-07-29; Andreas Jellinghaus 
    47* add support for Rutoken ECP (ccid driver) 
    58* small bugfixes 
    69 
    7 New in 0.6.16, 2009-05-04; Andreas Jellinghaus 
     10New in 0.6.16; 2009-05-04; Andreas Jellinghaus 
    811* For ccid, etoken* drivers remove polling loop, review the force_poll 
    912  configuration option, this reduces power consumption and CPU load. 
  • 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.