diff options
author | Evan Martin <martine@danga.com> | 2011-05-11 18:33:55 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-05-11 18:33:55 (GMT) |
commit | f2e57ebbb3e4bb40f837252707e129734a104f55 (patch) | |
tree | fba4ff4bf18bd029eb1729fd1389bbd2258b4e76 /src | |
parent | eccebffca22672b4f9d4c381e38eaad5884c352f (diff) | |
download | Ninja-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.cc | 5 |
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); } |