summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);