grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gfxterm: check elements' properties and hadle errors.


From: Andrey Borzenkov
Subject: Re: [PATCH] gfxterm: check elements' properties and hadle errors.
Date: Wed, 6 Mar 2013 22:05:55 +0400

В Mon, 04 Mar 2013 15:27:51 +0400
Vladimir Testov <address@hidden> пишет:

> GRUB does not show errors about non-existing properties or wrong values.
> property name and error hadling works only for global properties
> 
> This patch fixes this misbehavior.
> 

I find diff -p... generally more readable by providing context around
changes. May be my personal preference.

> --- grub-2.00/grub-core/gfxmenu/theme_loader.c        2012-02-24 
> 14:19:45.000000000 +0400
> +++ grub-patch/grub-core/gfxmenu/theme_loader.c       2013-03-04 
> 15:01:36.112753989 +0400
> @@ -557,7 +557,16 @@
>       parse_proportional_spec (value, &component->h, &component->hfrac);
>        else
>       /* General property handling.  */
> -     component->ops->set_property (component, property, value);
> +        {
> +          grub_err_t error = component->ops->set_property (component, 
> property, value);
> +          if (error != GRUB_ERR_NONE)
> +            {
> +              grub_error (GRUB_ERR_IO,
> +                          "%s:%d:%d unknown property or wrong value 
> `%s'=`%s'",
> +                          p->filename, p->line_num, p->col_num,
> +                          property, value);
> +            }
> +        }

This loses original OOM error if it was returned. May be make it return
true/false and check if grub_errno is set on false. Not sure.

Do you have any real problem to solve? I wonder if these errors are
visible to user at all; if not, setting them does not really buy
anything.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]