Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NCL89-0001D6-R9 for mharc-grub-devel@gnu.org; Sun, 22 Nov 2009 17:42:05 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NCL88-0001Cz-F4 for grub-devel@gnu.org; Sun, 22 Nov 2009 17:42:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NCL83-0001CJ-Qj for grub-devel@gnu.org; Sun, 22 Nov 2009 17:42:04 -0500 Received: from [199.232.76.173] (port=53926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NCL83-0001CG-NV for grub-devel@gnu.org; Sun, 22 Nov 2009 17:41:59 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:55847 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCL83-00034e-3h for grub-devel@gnu.org; Sun, 22 Nov 2009 17:41:59 -0500 Received: from pinux (82-45-164-87.cable.ubr06.hari.blueyonder.co.uk [82.45.164.87]) by mail.pina.cat (Postfix) with ESMTP id 10666288FBA1E for ; Sun, 22 Nov 2009 23:41:58 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id 79FEE452F; Sun, 22 Nov 2009 22:42:03 +0000 (GMT) Date: Sun, 22 Nov 2009 22:42:03 +0000 From: Carles Pina i Estany To: The development of GNU GRUB Message-ID: <20091122224203.GC5440@pina.cat> References: <20091122171919.GD11942@pina.cat> <20091122213240.GA13203@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091122213240.GA13203@thorin> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: errno handling X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 22:42:04 -0000 Hello, On Nov/22/2009, Robert Millan wrote: > On Sun, Nov 22, 2009 at 05:19:19PM +0000, Carles Pina i Estany wrote: > > > > Hello, > > > > Last night I spent some time with a confussion that maybe it can be > > avoided (or maybe not). > > > > Let's say that a module calls grub_file_open and it fails (file doesn't > > exist or whatever). grub_errno is setted up. > > > > This module is not resetting grub_errno and makes another call to > > grub_file_open with a valid file. But grub_file_open does: > > In theory, each layer should check errno after a call that may be > setting it. It's up to the layer whether errno has to be ignored > (and reset), handled or passed to the upper layer. In my opinion grub_file_open should reset grub_errno because grub_file_open behaviour is different up to the grub_errno when it enters in the function (if grub_errno != GRUB_ERRNO then grub_file_open will not open any file). And this for more functions. Not sure if some parts of Grub are relaying on the behaviour that I would remove :-) or what happens in the standard libraries related to it. -- Carles Pina i Estany http://pinux.info