summaryrefslogtreecommitdiffstats
path: root/commands/ubiformat.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-20 12:26:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-21 08:58:59 +0100
commit06bf4ad55b47d2bb561d2c0a967b436c855a21d4 (patch)
tree764e2d2724e514e5d55538ee955de411465b5854 /commands/ubiformat.c
parent22d747e264d7dacebaaa0d2759e6aace78355f8c (diff)
downloadbarebox-06bf4ad55b47d2bb561d2c0a967b436c855a21d4.tar.gz
barebox-06bf4ad55b47d2bb561d2c0a967b436c855a21d4.tar.xz
ubiformat: open flash image readonly
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>
Diffstat (limited to 'commands/ubiformat.c')
-rw-r--r--commands/ubiformat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/ubiformat.c b/commands/ubiformat.c
index 3bb2c9a9f5..efe1fde9fa 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);