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 @@ 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);