[PATCH 2/4] loadenv: ignore -ENOENT when removing /env

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With the -s option loadenv first removes /env. Ignore it when this
directory does not exist.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux