From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JIKAU-0000O3-Jb for mharc-grub-devel@gnu.org; Fri, 25 Jan 2008 03:44:10 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIKAS-0000Ly-P2 for grub-devel@gnu.org; Fri, 25 Jan 2008 03:44:08 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIKAR-0000Kd-Pw for grub-devel@gnu.org; Fri, 25 Jan 2008 03:44:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIKAR-0000KR-Kj for grub-devel@gnu.org; Fri, 25 Jan 2008 03:44:07 -0500 Received: from smtp-vbr8.xs4all.nl ([194.109.24.28]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JIKAR-0001Ia-8C for grub-devel@gnu.org; Fri, 25 Jan 2008 03:44:07 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr8.xs4all.nl (8.13.8/8.13.8) with ESMTP id m0P8i5Af079247 for ; Fri, 25 Jan 2008 09:44:05 +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> <1201199662.19286.4.camel@dv> Mail-Copies-To: mgerards@xs4all.nl Date: Fri, 25 Jan 2008 09:45:26 +0100 In-Reply-To: <1201199662.19286.4.camel@dv> (Pavel Roskin's message of "Thu, 24 Jan 2008 13:34:22 -0500") Message-ID: <87wspyl2e1.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:44:09 -0000 Pavel Roskin writes: > On Thu, 2008-01-24 at 20:08 +0200, Vesa J=E4=E4skel=E4inen wrote: > >> Previous behavior was working correctly. You have to handle >> errorcodes=20 >> at some point and that means when error is handled it is zeroed (or=20 >> GRUB_ERR_NONE). So code is in callee where that loop was. > > I suggest that we never set grub_errno to 0 (except the initialization). > That would match the standard errno behavior: > > http://www.opengroup.org/onlinepubs/009695399/functions/errno.html That just wouldn't work, it is not how the current code was designed. For example when you open a file, first the filesystem type has to be detected. So first you try filesystem A, after that filesystem B, etc. A returns an error, B too, etc. Some of these errors (out of memory) should immediately be reported back to the caller. Others, like wrong filesystem type are normal. We just clear the error and continue. It's like exception handling in C++. You can choose which errors you handle at a certain level. -- Marco