From: Christian Franke <Christian.Franke@t-online.de>
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 00:02:28 +0200 [thread overview]
Message-ID: <4A6A2F74.3070803@t-online.de> (raw)
In-Reply-To: <1248472159.4713.8.camel@mj>
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.
Yes correct.
> 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.
>
>
It depends: If DT_UNKNOWN is used, you have to replace stat() by lstat()
in is_dir(). Otherwise symlinked directories would be appear as dir only
if d_type == DT_UNKNOWN and not if d_type == DT_LNK.
> 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.
>
>
I would suggest to remove it.
--
Regards,
Christian Franke
next prev parent reply other threads:[~2009-07-24 22:02 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 [this message]
2009-07-25 16:23 ` Robert Millan
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=4A6A2F74.3070803@t-online.de \
--to=christian.franke@t-online.de \
--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.