[PATCH 2/4] loadenv: ignore -ENOENT when removing /env
Sascha Hauer
s.hauer at pengutronix.de
Wed Apr 9 00:39:24 PDT 2014
With the -s option loadenv first removes /env. Ignore it when this
directory does not exist.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
commands/loadenv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/loadenv.c b/commands/loadenv.c
index 7b93e86..a39ca8c 100644
--- a/commands/loadenv.c
+++ b/commands/loadenv.c
@@ -80,7 +80,7 @@ static int do_loadenv(int argc, char *argv[])
int ret;
ret = unlink_recursive(dirname, NULL);
- if (ret) {
+ if (ret && ret != -ENOENT) {
eprintf("cannot remove %s: %s\n", dirname,
strerror(-ret));
return 1;
--
1.9.1
More information about the barebox
mailing list