Edge* edge = i->second;
subproc_to_edge_.erase(i);
- if (!*success)
- printf("FAILED: %s\n", edge->EvaluateCommand().c_str());
- if (!subproc->stdout_.buf_.empty())
- printf("%s\n", subproc->stdout_.buf_.c_str());
- if (!subproc->stderr_.buf_.empty())
- printf("%s\n", subproc->stderr_.buf_.c_str());
+ if (!*success ||
+ !subproc->stdout_.buf_.empty() ||
+ !subproc->stderr_.buf_.empty()) {
+ printf("\n%s%s\n", *success ? "" : "FAILED: ",
+ edge->EvaluateCommand().c_str());
+ if (!subproc->stdout_.buf_.empty())
+ printf("%s\n", subproc->stdout_.buf_.c_str());
+ if (!subproc->stderr_.buf_.empty())
+ printf("%s\n", subproc->stderr_.buf_.c_str());
+ }
delete subproc;
return edge;