From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] loadenv: ignore -ENOENT when removing /env
Date: Wed, 9 Apr 2014 09:39:24 +0200 [thread overview]
Message-ID: <1397029166-4412-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1397029166-4412-1-git-send-email-s.hauer@pengutronix.de>
With the -s option loadenv first removes /env. Ignore it when this
directory does not exist.
Signed-off-by: Sascha Hauer <s.hauer@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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-04-09 7:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 7:39 Fix some longstanding environment bugs Sascha Hauer
2014-04-09 7:39 ` [PATCH 1/4] unlink_recursive: return negative error value Sascha Hauer
2014-04-09 7:39 ` Sascha Hauer [this message]
2014-04-09 7:39 ` [PATCH 3/4] saveenv: Properly detect write errors Sascha Hauer
2014-04-09 7:39 ` [PATCH 4/4] loadenv: detect truncated environment files Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1397029166-4412-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox