Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] package/makedevs: add recursive option
Date: Sat, 11 Apr 2015 10:28:38 +0200	[thread overview]
Message-ID: <87sic7cbm1.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <CA+TH9V=__byXvPOE+qd6Jkj2cv+g9gfvPX-Wsgmq=4QQ2_7W=g@mail.gmail.com> (Angelo Compagnucci's message of "Sat, 11 Apr 2015 09:00:05 +0200")

>>>>> "Angelo" == Angelo Compagnucci <angelo.compagnucci@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 

  reply	other threads:[~2015-04-11  8:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 10:50 [Buildroot] [PATCH 0/2] Makedevs: add recursive option Angelo Compagnucci
2015-03-13 10:50 ` [Buildroot] [PATCH 1/2] package/makedevs: " Angelo Compagnucci
2015-04-04 23:17   ` Angelo Compagnucci
2015-04-05  7:12     ` Peter Korsgaard
2015-04-09 21:23   ` Yann E. MORIN
2015-04-10  5:39     ` Angelo Compagnucci
2015-04-10 17:33       ` Yann E. MORIN
2015-04-10 21:41   ` Peter Korsgaard
2015-04-11  7:00     ` Angelo Compagnucci
2015-04-11  8:28       ` Peter Korsgaard [this message]
2015-03-13 10:50 ` [Buildroot] [PATCH 2/2] docs/manual: documentation for recursive makedevs syntax Angelo Compagnucci
2015-03-23 10:00 ` [Buildroot] [PATCH 0/2] Makedevs: add recursive option Angelo Compagnucci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sic7cbm1.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox