diff options
author | Hai Zhang <zhanghai@google.com> | 2020-05-14 16:37:09 -0700 |
---|---|---|
committer | Hai Zhang <zhanghai@google.com> | 2020-05-19 00:27:32 +0000 |
commit | b1a770671675d43c7518f964dd6c2f923ec2d9f5 (patch) | |
tree | f6702b058c31030f79981c81c463c6aed2566827 /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | c8cd1ad532a972dc5804c5800afc995b1a794d51 (diff) |
Change AtomicFile to use rename-into-place.
The previous implementation of backing up beforehand doesn't handle
the case where the file is created for the first time, and might leave
a corrupted file in case of failure.
This new implementation creates a new file for writing data into, and
renames it into the place of the original file after writing
finished.
Fixes: 151959443
Test: atest android.util.AtomicFileTest
Change-Id: I5c4c438526a2aecdd2af18f71e16b41a05817c61
Merged-In: I5c4c438526a2aecdd2af18f71e16b41a05817c61
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions