quick fix: write out signature in recompaction
authorEvan Martin <martine@danga.com>
Wed, 11 May 2011 18:33:55 +0000 (11:33 -0700)
committerEvan Martin <martine@danga.com>
Wed, 11 May 2011 18:33:55 +0000 (11:33 -0700)
This needs refactoring but I already pushed the bad code so this
hopefully makes it less broken.

src/build_log.cc

index c630fbe..2050ffc 100644 (file)
@@ -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);
   }