From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MUSqj-0005IP-Hl for mharc-grub-devel@gnu.org; Fri, 24 Jul 2009 18:02:45 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUSqh-0005Hf-JT for grub-devel@gnu.org; Fri, 24 Jul 2009 18:02:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUSqc-0005Fm-Sn for grub-devel@gnu.org; Fri, 24 Jul 2009 18:02:42 -0400 Received: from [199.232.76.173] (port=46251 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUSqc-0005Fh-I4 for grub-devel@gnu.org; Fri, 24 Jul 2009 18:02:38 -0400 Received: from mailout09.t-online.de ([194.25.134.84]:59963) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MUSqb-0001Ha-RR for grub-devel@gnu.org; Fri, 24 Jul 2009 18:02:38 -0400 Received: from fwd02.aul.t-online.de by mailout09.t-online.de with smtp id 1MUSqa-00046u-01; Sat, 25 Jul 2009 00:02:36 +0200 Received: from [10.3.2.2] (Vrm0BuZYQhSwg+SNytnEdGHpJ+Nj9eLvnht2gJTWt7-98Fq7hJx2xpsH2vuu5rSwZM@[217.235.180.104]) by fwd02.aul.t-online.de with esmtp id 1MUSqK-1IRu880; Sat, 25 Jul 2009 00:02:20 +0200 Message-ID: <4A6A2F74.3070803@t-online.de> Date: Sat, 25 Jul 2009 00:02:28 +0200 From: Christian Franke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090403 SeaMonkey/1.1.16 MIME-Version: 1.0 To: The development of GRUB 2 References: <1248386224.2661.118.camel@mj> <4A6A2165.3070100@t-online.de> <1248472159.4713.8.camel@mj> In-Reply-To: <1248472159.4713.8.camel@mj> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: Vrm0BuZYQhSwg+SNytnEdGHpJ+Nj9eLvnht2gJTWt7-98Fq7hJx2xpsH2vuu5rSwZM X-TOI-MSGID: a5d15a3e-208f-428b-a143-6f1606fdad68 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [BUGFIX] Don't use DT_DIR: It doesn't work on non-ext* filesystems X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 22:02:44 -0000 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