summaryrefslogtreecommitdiffstats
path: root/dex2oat
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2014-09-23 21:13:28 -0700
committerBrian Carlstrom <bdc@google.com>2014-09-23 23:58:19 -0700
commit4f694baebb578b3ecc0c431f2a05c92efb9a50b3 (patch)
tree33c14cf4133ce5efa716721289a922dfa00f4803 /dex2oat
parentf038ed9f031acb9c4fdf8a7f86e3c7ffad537e37 (diff)
downloadandroid_art-4f694baebb578b3ecc0c431f2a05c92efb9a50b3.tar.gz
android_art-4f694baebb578b3ecc0c431f2a05c92efb9a50b3.tar.bz2
android_art-4f694baebb578b3ecc0c431f2a05c92efb9a50b3.zip
dex2oat should truncate files opened from file descriptors
Bug: 17622827 (cherry picked from commit aa93129ca54cc897fdc2c8ddd0a7136f7b5632ed) Change-Id: I5467d488b4a57f7be35c72c16775df5bd5d69a52
Diffstat (limited to 'dex2oat')
-rw-r--r--dex2oat/dex2oat.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index afc01dce2e..9e6e95855b 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1252,6 +1252,7 @@ static int dex2oat(int argc, char** argv) {
} else {
oat_file.reset(new File(oat_fd, oat_location));
oat_file->DisableAutoClose();
+ oat_file->SetLength(0);
}
if (oat_file.get() == nullptr) {
PLOG(ERROR) << "Failed to create oat file: " << oat_location;