summaryrefslogtreecommitdiffstats
path: root/src/build_log.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2013-07-08 20:55:23 (GMT)
committerEvan Martin <martine@danga.com>2013-07-08 20:55:23 (GMT)
commit699d678774bfae538f3f555abd6ac3d91e968f52 (patch)
tree9cf7eee3cd60073452bb9b2f0f8f4dc5630a7df0 /src/build_log.cc
parentd9f50f48ae7e8a223a58c3fbb90fc4a54e426b09 (diff)
parent8de46a9685f562b75319bb48263e8c787e86d48b (diff)
downloadNinja-699d678774bfae538f3f555abd6ac3d91e968f52.zip
Ninja-699d678774bfae538f3f555abd6ac3d91e968f52.tar.gz
Ninja-699d678774bfae538f3f555abd6ac3d91e968f52.tar.bz2
Merge pull request #616 from nico/recompact
Add a 'recompact' tool, which forces recompaction of the build and deps ...
Diffstat (limited to 'src/build_log.cc')
-rw-r--r--src/build_log.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index a040ce2..6fb179a 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -110,7 +110,6 @@ BuildLog::~BuildLog() {
bool BuildLog::OpenForWrite(const string& path, string* err) {
if (needs_recompaction_) {
- Close();
if (!Recompact(path, err))
return false;
}
@@ -352,6 +351,7 @@ bool BuildLog::Recompact(const string& path, string* err) {
METRIC_RECORD(".ninja_log recompact");
printf("Recompacting log...\n");
+ Close();
string temp_path = path + ".recompact";
FILE* f = fopen(temp_path.c_str(), "wb");
if (!f) {