avrdude-dev
[Top][All Lists]
Advanced

[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: Joerg Wunsch
Subject: Re: [avrdude-dev] PATCH: Only open USB device after the correct vendor/product ID has been identified
Date: Fri, 27 Jan 2012 14:08:51 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

As Stephen Roe wrote:

> In this function the usb device if first opened before the the vendor
> and product id is checked.  This is not necessary and causes warnings
> to be printed to stderr for every usb device that is tried before the
> required device is found if the current user does not have permissions
> for that particular device.

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).

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.

> Please see the below patch that corrects this behaviour.  I have built
> and tested this against the 5.11 tarball.

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.
-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]