From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH] ubiformat: open flash image readonly
Date: Wed, 20 Feb 2013 12:27:48 +0100 [thread overview]
Message-ID: <1361359668-3331-1-git-send-email-s.hauer@pengutronix.de> (raw)
ubiformat only needs readonly access to the image to flash, so
open it readonly. Opening r/w may fail for example on tftp servers.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
commands/ubiformat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/ubiformat.c b/commands/ubiformat.c
index 3bb2c9a..efe1fde 100644
--- a/commands/ubiformat.c
+++ b/commands/ubiformat.c
@@ -233,7 +233,7 @@ static int open_file(off_t *sz)
return sys_errmsg("cannot open \"%s\"", args.image);
*sz = st.st_size;
- fd = open(args.image, O_RDWR);
+ fd = open(args.image, O_RDONLY);
if (fd < 0)
return sys_errmsg("cannot open \"%s\"", args.image);
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
reply other threads:[~2013-02-20 11:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1361359668-3331-1-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