View | Details | Raw Unified
Collapse All | Expand All

(-) libusb-0.1.12/linux.c (+7 lines)
 Lines 220-225    Link Here 
    waiting = 1;
    waiting = 1;
    context = NULL;
    context = NULL;
    while (!urb.usercontext && ((ret = ioctl(dev->fd, IOCTL_USB_REAPURBNDELAY, &context)) == -1) && waiting) {
    while (!urb.usercontext && ((ret = ioctl(dev->fd, IOCTL_USB_REAPURBNDELAY, &context)) == -1) && waiting) {
      if (ret == -1)
      {
      	if (errno == ENODEV)
	{
	  return -ENODEV;
	}
      }
      tv.tv_sec = 0;
      tv.tv_sec = 0;
      tv.tv_usec = 1000; // 1 msec
      tv.tv_usec = 1000; // 1 msec
      select(dev->fd + 1, NULL, &writefds, NULL, &tv); //sub second wait
      select(dev->fd + 1, NULL, &writefds, NULL, &tv); //sub second wait