summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-11-30 12:16:09 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-11-30 12:19:08 +0100
commit21ec7b89cce2b080f45f56255831f7b5a03bb1e5 (patch)
tree35d7b522f4f5e6c26228c97733a054355e857fae
parent89ad75d8a64394a9ffd873c9b717f6a007c4617e (diff)
downloadbarebox-21ec7b89cce2b080f45f56255831f7b5a03bb1e5.tar.gz
common: globalvar: fix removing multiple nvvars with wildcards
nvvar_remove takes wildcards, so it can remove multiple variables. This means we cannot return after the first loop iteration, but instead must continue. Fixes: 609d3edc3ad9 (common: globvar: let nvvar_remove() report non-existing variable) Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc:
-rw-r--r--common/globalvar.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/globalvar.c b/common/globalvar.c
index ee756e5..77b89c1 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -247,6 +247,7 @@ int nvvar_remove(const char *name)
{
struct param_d *p, *tmp;
char *fname;
+ int ret = -ENOENT;
if (!IS_ENABLED(CONFIG_NVVAR))
return -ENOSYS;
@@ -262,10 +263,10 @@ int nvvar_remove(const char *name)
unlink(fname);
free(fname);
- return 0;
+ ret = 0;
}
- return -ENOENT;
+ return ret;
}
int nvvar_load(void)