mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ubiformat: open flash image readonly
@ 2013-02-20 11:27 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2013-02-20 11:27 UTC (permalink / raw)
  To: barebox

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-20 11:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-20 11:27 [PATCH] ubiformat: open flash image readonly Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox