OSDN Git Service

Use PwriteFully and write image header last
authorMathieu Chartier <mathieuc@google.com>
Wed, 9 Mar 2016 19:14:50 +0000 (11:14 -0800)
committerMathieu Chartier <mathieuc@google.com>
Wed, 9 Mar 2016 23:57:24 +0000 (15:57 -0800)
commitdba5a70977da0a28cec2bfc8261d52a177738477
treeec9472c7c4c1942d6307bffeb2c70c83e896ddbf
parent05752398db7f25d7892b62cb39615eee468f1db8
Use PwriteFully and write image header last

Prevent corrupted images if dex2oat gets killed or if the image
writer is interrupted during writing.

Bug: 22858531
Bug: 27561308

Change-Id: Ia882d23d672f93c90733fc59a1f6508b0985a011
compiler/image_writer.cc
runtime/base/unix_file/fd_file.cc
runtime/base/unix_file/fd_file.h
runtime/base/unix_file/fd_file_test.cc