summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-05-11 18:33:55 (GMT)
committerEvan Martin <martine@danga.com>2011-05-11 18:33:55 (GMT)
commitf2e57ebbb3e4bb40f837252707e129734a104f55 (patch)
treefba4ff4bf18bd029eb1729fd1389bbd2258b4e76 /src
parenteccebffca22672b4f9d4c381e38eaad5884c352f (diff)
downloadNinja-f2e57ebbb3e4bb40f837252707e129734a104f55.zip
Ninja-f2e57ebbb3e4bb40f837252707e129734a104f55.tar.gz
Ninja-f2e57ebbb3e4bb40f837252707e129734a104f55.tar.bz2
quick fix: write out signature in recompaction
This needs refactoring but I already pushed the bad code so this hopefully makes it less broken.
Diffstat (limited to 'src')
-rw-r--r--src/build_log.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index c630fbe..2050ffc 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -206,6 +206,11 @@ bool BuildLog::Recompact(const string& path, string* err) {
return false;
}
+ if (fwrite(kFileSignature, sizeof(kFileSignature) - 1, 1, log_file_) < 1) {
+ *err = strerror(errno);
+ return false;
+ }
+
for (Log::iterator i = log_.begin(); i != log_.end(); ++i) {
WriteEntry(f, *i->second);
}