libftdi Archives

Subject: Re: [PATCH] Fixed first device failure in open_desc function

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: amurray@xxxxxxxxxxxxxxxxxxxx, Harrison Marcks <hmarcks@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Aug 2022 17:31:22 +0200
> You wrote on Thu, Jul 07, 2022 at 02:30:47PM +0100:
> >          if (desc.idVendor == vendor && desc.idProduct == product)
> >          {
> > +            open_counter++;
> >              if (libusb_open(dev, &ftdi->usb_dev) < 0)
> > -                ftdi_error_return_free_device_list(-4, "usb_open() 
> > failed", devs);
> > +            {
> > +                open_fail_counter++;
> > +                error_code = -4;
> > +                continue;
> > +            }
> 
> why does the open_counter get increased before
> and after libusb_open()?

A friendly soul pointed out to me off list that it's
"open_counter" and "open_fail_counter" the second time.

He also misread it the first time, so we should probably
find a different name for those variables if the logic is going to stay.

Cheers,
Thomas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread