Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JIKIE-0005hi-RJ for mharc-grub-devel@gnu.org; Fri, 25 Jan 2008 03:52:10 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIKIA-0005fu-EX for grub-devel@gnu.org; Fri, 25 Jan 2008 03:52:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIKI8-0005et-0s for grub-devel@gnu.org; Fri, 25 Jan 2008 03:52:05 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIKI7-0005ep-MV for grub-devel@gnu.org; Fri, 25 Jan 2008 03:52:03 -0500 Received: from smtp-vbr3.xs4all.nl ([194.109.24.23]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JIKI7-0004AY-6I for grub-devel@gnu.org; Fri, 25 Jan 2008 03:52:03 -0500 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr3.xs4all.nl (8.13.8/8.13.8) with ESMTP id m0P8q1ER000902 for ; Fri, 25 Jan 2008 09:52:02 +0100 (CET) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <4798fefb.04d2260a.2430.ffffbc6bSMTPIN_ADDED@mx.google.com> <94a0ccbc0801241342h677d79devf4cdd8987a0c9921@mail.gmail.com> Mail-Copies-To: mgerards@xs4all.nl Date: Fri, 25 Jan 2008 09:53:23 +0100 In-Reply-To: <94a0ccbc0801241342h677d79devf4cdd8987a0c9921@mail.gmail.com> (Oleg Strikov's message of "Thu, 24 Jan 2008 21:42:19 +0000") Message-ID: <87k5lyl20s.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=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 Subject: Re: Grub-devel Digest, Vol 47, Issue 99 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:52:08 -0000 "Oleg Strikov" writes: >> >> Previous behavior was working correctly. You have to handle >> >> errorcodes >> >> at some point and that means when error is handled it is zeroed (or >> >> 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 > > But is it correct to check and handle errno in some `library` function (now > we do) ? I CAN, but i do not have to examine errno after each > non-error-free call; is it right? This documentation about errno does NOT match grub_errno, please keep that in mind :-) You should *always* check for errors. *always* check if memory allocation succeeded, etc. If you write code that ignored errors, it is broken. A more explicit approach would be letting every function return grub_err_t. -- Marco