diff options
author | Enrico Jorns <ejo@pengutronix.de> | 2017-11-01 08:27:08 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-11-03 08:51:21 +0100 |
commit | 609d3edc3ad963202c34c841b2e3b678eae6f0da (patch) | |
tree | d264a2a8accf675357f01c5aab6fcae8e6e8c1ed /common/globalvar.c | |
parent | 2145fdf074f9b377d2e8aefbcb4a1d3f114045f4 (diff) | |
download | barebox-609d3edc3ad963202c34c841b2e3b678eae6f0da.tar.gz barebox-609d3edc3ad963202c34c841b2e3b678eae6f0da.tar.xz |
common: globvar: let nvvar_remove() report non-existing variable
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 <ejo@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/globalvar.c')
-rw-r--r-- | common/globalvar.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) |