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:
parent
9bdd6c98eb
commit
4448dbb2e8
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue