diff options
author | Nico Weber <nicolasweber@gmx.de> | 2016-02-03 20:57:10 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2016-02-03 20:57:10 (GMT) |
commit | 27c87c5efdb5c5243550a9261c122a1e9d7d0c75 (patch) | |
tree | 723fcb3a1eb5d8399b4490ccdd04a096aebd9da9 /src/graph.cc | |
parent | 7d8f9ef43e261724be256ae69b1642b6729f776a (diff) | |
parent | e74cefa6c606d69ddfd6bc9b055ef0c697c4f29a (diff) | |
download | Ninja-27c87c5efdb5c5243550a9261c122a1e9d7d0c75.zip Ninja-27c87c5efdb5c5243550a9261c122a1e9d7d0c75.tar.gz Ninja-27c87c5efdb5c5243550a9261c122a1e9d7d0c75.tar.bz2 |
Merge pull request #1060 from bradking/deduplicate-disk-interface
Deduplicate disk abstraction infrastructure
Diffstat (limited to 'src/graph.cc')
-rw-r--r-- | src/graph.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/graph.cc b/src/graph.cc index 9e65675..98f1461 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -395,8 +395,15 @@ bool ImplicitDepLoader::LoadDeps(Edge* edge, string* err) { bool ImplicitDepLoader::LoadDepFile(Edge* edge, const string& path, string* err) { METRIC_RECORD("depfile load"); - string content = disk_interface_->ReadFile(path, err); - if (!err->empty()) { + // Read depfile content. Treat a missing depfile as empty. + string content; + switch (disk_interface_->ReadFile(path, &content, err)) { + case DiskInterface::Okay: + break; + case DiskInterface::NotFound: + err->clear(); + break; + case DiskInterface::OtherError: *err = "loading '" + path + "': " + *err; return false; } |