summaryrefslogtreecommitdiffstats
path: root/src/build.cc
diff options
context:
space:
mode:
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 5cf9d27..a2f430e 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -641,7 +641,10 @@ bool Builder::Build(string* err) {
}
--pending_commands;
- FinishCommand(&result);
+ if (!FinishCommand(&result, err)) {
+ status_->BuildFinished();
+ return false;
+ }
if (!result.success()) {
if (failures_allowed)
@@ -704,7 +707,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;
@@ -733,7 +736,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;
@@ -791,9 +794,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,