From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JIF95-00044y-AB for mharc-grub-devel@gnu.org; Thu, 24 Jan 2008 22:22:23 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIF93-00041B-GR for grub-devel@gnu.org; Thu, 24 Jan 2008 22:22:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIF91-0003xF-OP for grub-devel@gnu.org; Thu, 24 Jan 2008 22:22:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIF91-0003x1-I1 for grub-devel@gnu.org; Thu, 24 Jan 2008 22:22:19 -0500 Received: from c60.cesmail.net ([216.154.195.49]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1JIF91-0004iv-GL for grub-devel@gnu.org; Thu, 24 Jan 2008 22:22:19 -0500 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 24 Jan 2008 22:22:18 -0500 Received: from [192.168.1.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id 54424618FE1 for ; Thu, 24 Jan 2008 22:22:18 -0500 (EST) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <94a0ccbc0801241343p75ec7033h1ddb9d819163f846@mail.gmail.com> References: <94a0ccbc0801241343p75ec7033h1ddb9d819163f846@mail.gmail.com> Content-Type: text/plain Date: Thu, 24 Jan 2008 22:22:17 -0500 Message-Id: <1201231337.2811.7.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-1.fc8) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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 03:22:21 -0000 On Thu, 2008-01-24 at 21:43 +0000, Oleg Strikov wrote: > 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? I don't know how grub_errno is supposed to work, so I cannot comment on that. But normally it's OK to read errno if it's known that some error has happened. It makes it possible to have one error handler that would not specify which exactly call has failed. For instance, it's not important if an I/O error happened when opening the file or when reading from it, or when closing it. It should be OK to set errno to 0 only if it's definitely known that the callers (not necessarily the immediate caller) don't expect errno to be preserved. Therefore, setting errno to 0 in a library would be wrong. -- Regards, Pavel Roskin