[PATCH] ubiformat: open flash image readonly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux