summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorTeresa Remmet <t.remmet@phytec.de>2016-11-25 09:06:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-11 08:06:48 +0100
commit4448dbb2e8d02cae7bfe56b969317ec6ad5027e5 (patch)
tree43ce42ec2c9b98a344af70523b6cc6851b064ad8 /commands
parent9bdd6c98ebf21a6188ad9f2a6b98ed0edde7da00 (diff)
downloadbarebox-4448dbb2e8d02cae7bfe56b969317ec6ad5027e5.tar.gz
barebox-4448dbb2e8d02cae7bfe56b969317ec6ad5027e5.tar.xz
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>
Diffstat (limited to 'commands')
-rw-r--r--commands/ubi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/ubi.c b/commands/ubi.c
index 4c445d2216..5e2758400a 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;