From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MUSdy-00064c-BA for mharc-grub-devel@gnu.org; Fri, 24 Jul 2009 17:49:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUSdw-00064T-AU for grub-devel@gnu.org; Fri, 24 Jul 2009 17:49:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUSdq-00064H-TP for grub-devel@gnu.org; Fri, 24 Jul 2009 17:49:31 -0400 Received: from [199.232.76.173] (port=44804 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUSdq-00064E-OQ for grub-devel@gnu.org; Fri, 24 Jul 2009 17:49:26 -0400 Received: from c60.cesmail.net ([216.154.195.49]:60380) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MUSdq-0007hi-6i for grub-devel@gnu.org; Fri, 24 Jul 2009 17:49:26 -0400 Received: from unknown (HELO smtprelay1.cesmail.net) ([192.168.1.111]) by c60.cesmail.net with ESMTP; 24 Jul 2009 17:49:23 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay1.cesmail.net (Postfix) with ESMTPSA id A86E234C6D for ; Fri, 24 Jul 2009 17:49:20 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <4A6A2165.3070100@t-online.de> References: <1248386224.2661.118.camel@mj> <4A6A2165.3070100@t-online.de> Content-Type: text/plain Date: Fri, 24 Jul 2009 17:49:19 -0400 Message-Id: <1248472159.4713.8.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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 21:49:32 -0000 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. -- Regards, Pavel Roskin