From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JIKFE-00049R-Sv for mharc-grub-devel@gnu.org; Fri, 25 Jan 2008 03:49:04 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIKF8-00043J-Br for grub-devel@gnu.org; Fri, 25 Jan 2008 03:49:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIKF5-00041F-S8 for grub-devel@gnu.org; Fri, 25 Jan 2008 03:48:56 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIKF5-00040u-2F for grub-devel@gnu.org; Fri, 25 Jan 2008 03:48:55 -0500 Received: from smtp-vbr4.xs4all.nl ([194.109.24.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JIKF4-00034T-EZ for grub-devel@gnu.org; Fri, 25 Jan 2008 03:48:54 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr4.xs4all.nl (8.13.8/8.13.8) with ESMTP id m0P8mqFK001418 for ; Fri, 25 Jan 2008 09:48:53 +0100 (CET) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <94a0ccbc0801231500g752f72acodc37c733726d8919@mail.gmail.com> <20080124000544.GB32503@thorin> <4798D42E.7030506@nic.fi> Mail-Copies-To: mgerards@xs4all.nl Date: Fri, 25 Jan 2008 09:50:14 +0100 In-Reply-To: <4798D42E.7030506@nic.fi> (Vesa =?iso-8859-1?Q?J=E4=E4skel=E4?= =?iso-8859-1?Q?inen's?= message of "Thu, 24 Jan 2008 20:08:46 +0200") Message-ID: <87odbal261.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: /kern/file.c BUG 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, 25 Jan 2008 08:49:03 -0000 Vesa J=E4=E4skel=E4inen writes: (replying to this mail, I didn't receive the first mail over the list...) > Robert Millan wrote: >> On Wed, Jan 23, 2008 at 11:00:57PM +0000, Oleg Strikov wrote: >>> Incorrect behavior of grub_file_open () function in e.g. loop context: >>> >>> char *file_names[] =3D >>> { >>> "(hd0,1)/file1", //file do not exist >>> "(hd0,1)/file2" //file exist >>> }; >>> grub_file_t file; >>> int i; >>> for (i =3D 0; i < 2; i++) >>> { >>> file =3D grub_file_open (file_names[i]); >>> if (file) {...} >>> } >>> >>> There, we should get positive return in the second case (i =3D=3D 1), b= ut >>> grub_file_open() returns 0. No, that is not right. This behavior is correct. When you open the first file, you get an error which you ignore. If you think this error is harmless, clear it. So your code is wrong. -- Marco