diff options
author | Teresa Remmet <t.remmet@phytec.de> | 2016-11-25 09:06:06 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-01-11 08:06:48 +0100 |
commit | 4448dbb2e8d02cae7bfe56b969317ec6ad5027e5 (patch) | |
tree | 43ce42ec2c9b98a344af70523b6cc6851b064ad8 /commands | |
parent | 9bdd6c98ebf21a6188ad9f2a6b98ed0edde7da00 (diff) | |
download | barebox-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.c | 2 |
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; |