[PATCH 5/6] commands: ubi: ubiupdatevol: Open device with O_TRUNC

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

 



Static ubi volumes should be opend with O_TRUNC as the device file
size equals the content.

Signed-off-by: Teresa Remmet <t.remmet@xxxxxxxxx>
---
 commands/ubi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/ubi.c b/commands/ubi.c
index 4c445d2..5e27584 100644
--- a/commands/ubi.c
+++ b/commands/ubi.c
@@ -42,7 +42,7 @@ static int do_ubiupdatevol(int argc, char *argv[])
 		return 1;
 	}
 
-	fd_vol = open(argv[optind], O_WRONLY);
+	fd_vol = open(argv[optind], O_WRONLY | O_TRUNC);
 	if (fd_vol < 0) {
 		perror("open volume");
 		ret = 1;
-- 
1.9.1


_______________________________________________
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