9
0
Fork 0

commands: ubi: ubiupdatevol: Open device with O_TRUNC

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

Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Teresa Remmet 2016-11-25 09:06:06 +01:00 committed by Sascha Hauer
parent 9bdd6c98eb
commit 4448dbb2e8
1 changed files with 1 additions and 1 deletions

View File

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