All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [BUGFIX] Don't use DT_DIR: It doesn't work on non-ext* filesystems
Date: Sat, 25 Jul 2009 18:23:09 +0200	[thread overview]
Message-ID: <20090725162309.GH12326@thorin> (raw)
In-Reply-To: <1248472159.4713.8.camel@mj>

On Fri, Jul 24, 2009 at 05:49:19PM -0400, Pavel Roskin wrote:
> On Fri, 2009-07-24 at 23:02 +0200, Christian Franke wrote:
> 
> > A correct performance-aware solution would look like:
> > 
> > #ifdef DT_DIR
> >   if (de->d_type == DT_DIR)
> >     info.dir = 1;
> >   else if (de->type == DT_FILE)
> 
> There in no DT_FILE in glibc, but there is DT_REG.  DT_UNKNOWN is
> present.  Perhaps the above line should be
> 
> else if (de->type != DT_UNKNOWN)
> 
> We only care if it's a directory or not.  All other objects can be
> treated like files.
> 
> I'm fine either way, whether we fix the "high-performance" code or
> remove it, as long as we don't have to add more checks.

d_type doesn't always exist.  E.g. on OpenSolaris.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



      parent reply	other threads:[~2009-07-25 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23  9:29 [BUGFIX] Don't use DT_DIR: It doesn't work on non-ext* filesystems Vladimir 'phcoder' Serbinenko
2009-07-23 21:57 ` Pavel Roskin
2009-07-24 21:02   ` Christian Franke
2009-07-24 21:49     ` Pavel Roskin
2009-07-24 22:02       ` Christian Franke
2009-07-25 16:23       ` Robert Millan [this message]

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=20090725162309.GH12326@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.