summaryrefslogtreecommitdiffstats
path: root/src/build_log.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-08-17 17:25:21 (GMT)
committerEvan Martin <martine@danga.com>2012-08-17 17:35:41 (GMT)
commit697350d1220f50c32043875b49c71c8a294098a4 (patch)
tree970abb9bdef44e79f49423a1cf5646bb8e5743cd /src/build_log.cc
parent413103c4c472410c10da179a841b5e3b05e576c0 (diff)
downloadNinja-697350d1220f50c32043875b49c71c8a294098a4.zip
Ninja-697350d1220f50c32043875b49c71c8a294098a4.tar.gz
Ninja-697350d1220f50c32043875b49c71c8a294098a4.tar.bz2
make it more explicit that a bad build log causes us to rebuild
(Committing this on top of b56fe80 since they're related, but I may end up reverting both.)
Diffstat (limited to 'src/build_log.cc')
-rw-r--r--src/build_log.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index e72a93e..73c2b5d 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -235,10 +235,13 @@ bool BuildLog::Load(const string& path, string* err) {
sscanf(line_start, kFileSignature, &log_version);
if (log_version < kOldestSupportedVersion) {
- *err = "unable to extract version from build log, perhaps due to "
- "being too old; you must clobber your build output and rebuild";
+ *err = ("build log version invalid, perhaps due to being too old; "
+ "starting over");
fclose(file);
- return false;
+ unlink(path.c_str());
+ // Don't report this as a failure. An empty build log will cause
+ // us to rebuild the outputs anyway.
+ return true;
}
}