diff options
author | Evan Martin <martine@danga.com> | 2013-04-29 16:01:47 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2013-04-29 16:01:47 (GMT) |
commit | dc551ca7726ce5c5adc4e391d3d0fbfa7525f65b (patch) | |
tree | bb5d5b21557a7a5db4ff3a27b30239ab84031df9 /src/deps_log.cc | |
parent | 931b19d8e37908c12aadb24d11b6ef4f3a693ed7 (diff) | |
parent | 92f48ca30762447864ef808cf62ccd1ca76cd23d (diff) | |
download | Ninja-dc551ca7726ce5c5adc4e391d3d0fbfa7525f65b.zip Ninja-dc551ca7726ce5c5adc4e391d3d0fbfa7525f65b.tar.gz Ninja-dc551ca7726ce5c5adc4e391d3d0fbfa7525f65b.tar.bz2 |
Merge pull request #556 from nico/unlink
Make sure that recompaction writes a pristine new depslog.
Diffstat (limited to 'src/deps_log.cc')
-rw-r--r-- | src/deps_log.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc index 5ecdeef..6a48d50 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -244,6 +244,11 @@ bool DepsLog::Recompact(const string& path, string* err) { printf("Recompacting deps...\n"); string temp_path = path + ".recompact"; + + // OpenForWrite() opens for append. Make sure it's not appending to a + // left-over file from a previous recompaction attempt that crashed somehow. + unlink(temp_path.c_str()); + DepsLog new_log; if (!new_log.OpenForWrite(temp_path, err)) return false; |