From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ds6iH-0007Ys-MF for barebox@lists.infradead.org; Wed, 13 Sep 2017 12:24:24 +0000 From: Enrico Jorns Date: Wed, 13 Sep 2017 14:23:32 +0200 Message-Id: <20170913122332.17585-6-ejo@pengutronix.de> In-Reply-To: <20170913122332.17585-1-ejo@pengutronix.de> References: <20170913122332.17585-1-ejo@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 5/5] common: globvar: let nvvar_remove() report non-existing variable To: barebox@lists.infradead.org Cc: Enrico Jorns The former implementation did not allow to detect whether the call to nvvar_remove() succeeded or failed and always returned 0. This changes the implementation to return 0 only if a variable with the given name was found and return ENOENT otherwise. Signed-off-by: Enrico Jorns --- common/globalvar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/globalvar.c b/common/globalvar.c index fdfaf76fae..ee756e5140 100644 --- a/common/globalvar.c +++ b/common/globalvar.c @@ -261,9 +261,11 @@ int nvvar_remove(const char *name) unlink(fname); free(fname); + + return 0; } - return 0; + return -ENOENT; } int nvvar_load(void) -- 2.11.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox