Re: libusb & PATH_MAX
On Tue, May 19, 2009 at 12:19:10AM +0200, Samuel Thibault wrote:
> Carl Fredrik Hammar, le Mon 18 May 2009 15:07:49 +0200, a écrit :
> > 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.
> Yes. And that might never happen so we'd not have to recompile them.
Well the same thing could be said for simply defining PATH_MAX and that
has never been considered an acceptable solution AFAICT.
The mitigating factors in this case would be that it's an interim
solution until libusb2 is used, and that USB device paths are expected
to have short well defined paths, e.g. `/dev/usb/foo', or whatever.
But I can't tell whether they are sufficient.
> > 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.
> But how to detect them?
Since you asked, I'm guessing you can't just grep for it...
But why not wait until they actually break? The value likely isn't used
when there's no USB support, so this way we'll postpone the needed work.