[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] PATCH: Only open USB device after the correct vendor/p
From: |
Stephen Roe |
Subject: |
Re: [avrdude-dev] PATCH: Only open USB device after the correct vendor/product ID has been identified |
Date: |
Sun, 29 Jan 2012 20:25:46 +0000 |
On 27 January 2012 13:08, Joerg Wunsch <address@hidden> wrote:
> I think something is broken with your libusb implementation then.
> usb_open() is *not* supposed to print anything to stderr, much the
> same as a regular fopen() is not supposed to generate stderr output.
> They should simply report the error status back to the caller, and
> it's up to the caller to handle it (or inquire about the reason).
Your response triggered me to investigate this issue further (which I
should have done in the first place, sorry :( )For reference, I'm
using libusb v1.0.8 on linux. Upon investigation I found that there
was an issue with the linux back end of libusb where opening a device
which lacked user permissions printed a message to stderr. This has
been resolved in libusb v1.0.9-rc.
> The major advantage I could see by using your method is that we can
> then already be sure the desired device has been found, so if
> usb_open() fails afterwards, we could print out an appropriate error
> message (but your patch doesn't do that). Right now, we simply
> continue in that case, leaving the user under the impression no such
> device does exist on the bus.
I agree that it would be an advantage to change the order in order to
give better feedback to the end user.
> The patch doesn't apply. That's likely due to your mailer mangling
> the <TAB> characters that used to be there.
>
> Anyway, it's better to file a patch to the patch tracker:
>
> https://savannah.nongnu.org/patch/?group=avrdude
>
> rather than here in the list. This ensures it won't be forgotten, and
> as you can make the patch an attachment there, this also avoids
> problems like the <TAB> mangling.
I will modify the patch to include the extra feedback and then submit
it via the patch tracker as per your instruction.
--Stephen