Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JIjkH-0006mt-Uh for mharc-grub-devel@gnu.org; Sat, 26 Jan 2008 07:02:49 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIjkG-0006ma-Ci for grub-devel@gnu.org; Sat, 26 Jan 2008 07:02:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIjkB-0006lz-Us for grub-devel@gnu.org; Sat, 26 Jan 2008 07:02:48 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIjkB-0006lw-NY for grub-devel@gnu.org; Sat, 26 Jan 2008 07:02:43 -0500 Received: from smtp-vbr12.xs4all.nl ([194.109.24.32]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JIjkB-0000gT-6W for grub-devel@gnu.org; Sat, 26 Jan 2008 07:02:43 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr12.xs4all.nl (8.13.8/8.13.8) with ESMTP id m0QC2d4T024450 for ; Sat, 26 Jan 2008 13:02:40 +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> <87odbal261.fsf@xs4all.nl> <20080125235700.GA24946@thorin> Mail-Copies-To: mgerards@xs4all.nl Date: Sat, 26 Jan 2008 13:04:04 +0100 In-Reply-To: <20080125235700.GA24946@thorin> (Robert Millan's message of "Sat, 26 Jan 2008 00:57:00 +0100") Message-ID: <878x2cg5e3.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: Sat, 26 Jan 2008 12:02:48 -0000 Robert Millan writes: > On Fri, Jan 25, 2008 at 09:50:14AM +0100, Marco Gerards wrote: >> Vesa J=E4=E4skel=E4inen writes: >>=20 >> (replying to this mail, I didn't receive the first mail over the list...) >>=20 >> > 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 contex= t: >> >>> >> >>> 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)= , but >> >>> grub_file_open() returns 0. >>=20 >> No, that is not right. This behavior is correct. >>=20 >> 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. > > Ok, I reverted it. This will uncover another bug somewhere else. I can't > remember what it was about, though. Thanks. Can you look that up? If you found it, I can help you fixing it, if you'd like? -- Marco