summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2015-03-31 15:12:12 (GMT)
committerNico Weber <nicolasweber@gmx.de>2015-03-31 19:21:57 (GMT)
commit3beebde51a2089ecb01820f1428efe0263deaeea (patch)
tree55aec535c37434dbe5893e8ed37c69891b6d4b74 /src/graph.cc
parenta88b75d9a9df1b3722ad649ae275d342f3b57b22 (diff)
downloadNinja-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.cc8
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) {