From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UDJi7-0005wb-6b for mharc-grub-devel@gnu.org; Wed, 06 Mar 2013 14:09:07 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDJi4-0005tL-Lq for grub-devel@gnu.org; Wed, 06 Mar 2013 14:09:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDJi0-0004EN-69 for grub-devel@gnu.org; Wed, 06 Mar 2013 14:09:04 -0500 Received: from mail-bk0-x234.google.com ([2a00:1450:4008:c01::234]:56237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDIj0-0001zv-IE for grub-devel@gnu.org; Wed, 06 Mar 2013 13:05:58 -0500 Received: by mail-bk0-f52.google.com with SMTP id jk13so401205bkc.11 for ; Wed, 06 Mar 2013 10:05:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:in-reply-to:references :x-mailer:mime-version:content-type:content-transfer-encoding; bh=P4ISxflfOfGp5iS988oKN6zMJDlrb5Fv7A7hBau98R4=; b=u4azxzbQVDDA1WGHDPclWar4pix//oPfzjBP13O3+gIHyC3+1O0wmusCcXnAniaMJ0 80OtYTVZQb26YPNtIVdEB7OGm3ZSqgDw/Ndkig//MqSiW0WcAUYcFKTflkFr6Vh8syBS aSoMFBQckguwbA24+r4M6cu6c+28/R/pQP6bHv/oRveAjFCbUPBu8kmaAV6+DJwFul77 dMIw9KnJ/tTO8586vrcILPCiNxegQLpCx/MUCxwJmiR9BzOKPE/JhO50ICMN4dVLv12z ZuY0g/1cp3hmbKrHsBmPZCBXtFOXlyhU1mYpTIOb2w3eqbrLTNePBsmQQwiLTrcKnUzZ v2xQ== X-Received: by 10.204.145.86 with SMTP id c22mr11938887bkv.5.1362593157487; Wed, 06 Mar 2013 10:05:57 -0800 (PST) Received: from opensuse.site (ppp79-139-243-180.pppoe.spdop.ru. [79.139.243.180]) by mx.google.com with ESMTPS id g28sm8637487bkv.17.2013.03.06.10.05.56 (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 06 Mar 2013 10:05:56 -0800 (PST) Date: Wed, 6 Mar 2013 22:05:55 +0400 From: Andrey Borzenkov To: grub-devel@gnu.org Subject: Re: [PATCH] gfxterm: check elements' properties and hadle errors. Message-ID: <20130306220555.59cfa00a@opensuse.site> In-Reply-To: <3230726.ejrxcKfAuV@icedphoenix> References: <3230726.ejrxcKfAuV@icedphoenix> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.10; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4008:c01::234 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Wed, 06 Mar 2013 19:09:06 -0000 В Mon, 04 Mar 2013 15:27:51 +0400 Vladimir Testov пишет: > 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.