[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libusb & PATH_MAX



Hi,

On Sun, May 17, 2009 at 09:57:26PM +0200, Samuel Thibault wrote:
> Carl Fredrik Hammar, le Sun 17 May 2009 21:48:01 +0200, a écrit :
> > On Sun, May 17, 2009 at 09:23:38PM +0200, Samuel Thibault wrote:
> > > Carl Fredrik Hammar, le Sun 17 May 2009 21:18:57 +0200, a écrit :
> > > > In that case we could just remove the PATH_MAX.
> > > 
> > > That'd prevent from actually providing USB someday.
> > 
> > Yes, but I think we should wait with a real solution until we actually
> > have USB support and can test it.  In the mean time I think its best
> > to have a non-solution that breaks loudly as soon we do have USB.
> 
> I don't understand your reasoning.  What do you precisely mean by
> 'remove the PATH_MAX'?  Since you were talking about applications not
> even using the result I assumed you meant something like
> 
> 	char filename[1];

This is precisely what I meant.

> but then once compiled this way, these applications won't work even if
> after that we provide a libusb that works.

A similar problem happens when defining LIBUSB_PATH_MAX, but apps will
only break when paths longer than it are encountered.  Until that happens
it, this limitation might go unnoticed.

Using malloced memory is the ideal solution, but potentially a lot of
work.  When we actually have USB support, we will have more motivation
to implement it and the ability to actually test to see if it works.
Of course, the apps will need to be recompiled once it's in place.
Would this be a big problem?

If that's the case, then your suggestion of using char *filenname instead
would be supperior.  Since only apps using sizeof(filename) will need
to be fixed and recompiled.

Regards,
  Fredrik


Reply to: