[Buildroot] [PATCH 1/2] package/makedevs: add recursive option
Peter Korsgaard
peter at korsgaard.com
Sat Apr 11 08:28:38 UTC 2015
>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci at gmail.com> writes:
hi,
>> I know you are doing this because nftw doesn't allow any extra arguments
>> to be passed to the function, but using GCC specific nested functions
>> isn't really nice.
>> Does E.G. clang support these?
> Doh! I thought nested function could be a more widespread feature! Of
> course, you are right, clang doesn't support nested functions.
> The naive solution could be to add a global object, could be acceptable?
> There are only three variables and could be nested inside a nice structure.
Yes, or simply 3 globals (recursive_{uid,gid,mode}) to keep it simple.
>> Alternatively we could port
>> recursive_action() from busybox.
> / * Unfortunately, while nftw(3) could replace this and reduce
> * code size a bit, nftw() wasn't supported before GNU libc 2.1,
> * and so isn't sufficiently portable to take over since glibc2.1
> * is so stinking huge.
> */
> The only reason why they stick with an hand made recursive function
> instead of nftw is to support older glibc 2.1 (!) that doesn't have
> that function.
> I think it's not our problem and backporting that old code is not a good idea!
Yes, that AND the fact that recursive_action takes a userData structure
that gets forwarded to the callbacks.
But yeah, just using nftw with 3 globals is simpler.
--
Venlig hilsen,
Peter Korsgaard
More information about the buildroot
mailing list