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 1e97PJ-0002Q0-N8 for barebox@lists.infradead.org; Mon, 30 Oct 2017 10:35:08 +0000 From: Enrico Jorns Date: Mon, 30 Oct 2017 11:34:20 +0100 Message-Id: <20171030103421.15353-5-ejo@pengutronix.de> In-Reply-To: <20171030103421.15353-1-ejo@pengutronix.de> References: <20171030103421.15353-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 4/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