summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2013-01-08 16:17:12 (GMT)
committerEvan Martin <martine@danga.com>2013-04-08 22:01:42 (GMT)
commite801e67a4cfae117098f252d365d67704eba4bfd (patch)
tree3e14597b7bc10834e05fdf939fa3244e50849112 /src
parentafd206d99004d551afcfef55ec69ab65c4eb81d4 (diff)
downloadNinja-e801e67a4cfae117098f252d365d67704eba4bfd.zip
Ninja-e801e67a4cfae117098f252d365d67704eba4bfd.tar.gz
Ninja-e801e67a4cfae117098f252d365d67704eba4bfd.tar.bz2
make old deps format migration actually work
Diffstat (limited to 'src')
-rw-r--r--src/deps_log.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/deps_log.cc b/src/deps_log.cc
index 5706be4..081fcf0 100644
--- a/src/deps_log.cc
+++ b/src/deps_log.cc
@@ -128,12 +128,11 @@ bool DepsLog::Load(const string& path, State* state, string* err) {
return false;
}
int version = 0;
- if (sscanf(buf, kFileSignature, &version) != 1) {
- *err = "unable to read file signature";
- return false;
- }
+ sscanf(buf, kFileSignature, &version);
if (version != kCurrentVersion) {
- *err = "bad deps log version; starting over";
+ *err = "bad deps log signature or version; starting over";
+ fclose(f);
+ unlink(path.c_str());
// Don't report this as a failure. An empty deps log will cause
// us to rebuild the outputs anyway.
return true;