diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-03-31 15:12:12 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-03-31 19:21:57 (GMT) |
commit | 3beebde51a2089ecb01820f1428efe0263deaeea (patch) | |
tree | 55aec535c37434dbe5893e8ed37c69891b6d4b74 /src/graph.cc | |
parent | a88b75d9a9df1b3722ad649ae275d342f3b57b22 (diff) | |
download | Ninja-3beebde51a2089ecb01820f1428efe0263deaeea.zip Ninja-3beebde51a2089ecb01820f1428efe0263deaeea.tar.gz Ninja-3beebde51a2089ecb01820f1428efe0263deaeea.tar.bz2 |
Let Stat() have an err outparam instead of writing to stderr.
Also check for Stat() failure in a few more places.
This way, ninja doesn't print two "ninja: error: " lines if stat() fails
during a build. It also makes it easier to keep the stat tests quiet.
Every caller of Stat() needs to explicitly log the error string if
that's desired.
Diffstat (limited to 'src/graph.cc')
-rw-r--r-- | src/graph.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/graph.cc b/src/graph.cc index d99c8bd..fcfeba0 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -29,13 +29,7 @@ bool Node::Stat(DiskInterface* disk_interface, string* err) { METRIC_RECORD("node stat"); - mtime_ = disk_interface->Stat(path_); - if (mtime_ == -1) { - // TODO: Let DiskInterface::Stat() take err instead of it calling Error(). - *err = "stat failed"; - return false; - } - return true; + return (mtime_ = disk_interface->Stat(path_, err)) != -1; } bool DependencyScan::RecomputeDirty(Edge* edge, string* err) { |