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


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to