summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-07-24 20:30:29 (GMT)
committerNico Weber <nicolasweber@gmx.de>2013-07-24 20:30:29 (GMT)
commitf6f00aa40f0c541df06747228b1cc928d4972b3e (patch)
treedec640236366316f728cbab43f1107c26430da39 /src/build.cc
parent7c9220bbfa5d081a1109a25733805f17b1e0b284 (diff)
parent70f18e1138c9af638afae95b8a521c257e42ccce (diff)
downloadNinja-f6f00aa40f0c541df06747228b1cc928d4972b3e.zip
Ninja-f6f00aa40f0c541df06747228b1cc928d4972b3e.tar.gz
Ninja-f6f00aa40f0c541df06747228b1cc928d4972b3e.tar.bz2
Merge pull request #612 from maximuska/proposed/deps_log_write_errors_checking
Proposed/deps log write errors checking
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/build.cc b/src/build.cc
index 143aeb2..67e4634 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -639,7 +639,10 @@ bool Builder::Build(string* err) {
}
--pending_commands;
- FinishCommand(&result);
+ if (!FinishCommand(&result, err)) {
+ status_->BuildFinished();
+ return false;
+ }
if (!result.success()) {
if (failures_allowed)
@@ -702,7 +705,7 @@ bool Builder::StartEdge(Edge* edge, string* err) {
return true;
}
-void Builder::FinishCommand(CommandRunner::Result* result) {
+bool Builder::FinishCommand(CommandRunner::Result* result, string* err) {
METRIC_RECORD("FinishCommand");
Edge* edge = result->edge;
@@ -731,7 +734,7 @@ void Builder::FinishCommand(CommandRunner::Result* result) {
// The rest of this function only applies to successful commands.
if (!result->success())
- return;
+ return true;
// Restat the edge outputs, if necessary.
TimeStamp restat_mtime = 0;
@@ -789,9 +792,12 @@ void Builder::FinishCommand(CommandRunner::Result* result) {
assert(edge->outputs_.size() == 1 && "should have been rejected by parser");
Node* out = edge->outputs_[0];
TimeStamp deps_mtime = disk_interface_->Stat(out->path());
- scan_.deps_log()->RecordDeps(out, deps_mtime, deps_nodes);
+ if (!scan_.deps_log()->RecordDeps(out, deps_mtime, deps_nodes)) {
+ *err = string("Error writing to deps log: ") + strerror(errno);
+ return false;
+ }
}
-
+ return true;
}
bool Builder::ExtractDeps(CommandRunner::Result* result,