summaryrefslogtreecommitdiffstats
path: root/src/ninja_jumble.cc
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2011-04-14 08:59:13 (GMT)
committerNicolas Despres <nicolas.despres@gmail.com>2011-04-26 11:20:08 (GMT)
commit62d48b0887d9fd82f2fb56e928f4879daf4cc907 (patch)
treefdd98e030d4fcdce32e16833b6905a7c00bc2640 /src/ninja_jumble.cc
parentb471f2db6e79abeda1717f3f136bc369eb916958 (diff)
downloadNinja-62d48b0887d9fd82f2fb56e928f4879daf4cc907.zip
Ninja-62d48b0887d9fd82f2fb56e928f4879daf4cc907.tar.gz
Ninja-62d48b0887d9fd82f2fb56e928f4879daf4cc907.tar.bz2
Use Error() to report error.
This way we get the error message prefixed by the program name. It helps while debugging.
Diffstat (limited to 'src/ninja_jumble.cc')
-rw-r--r--src/ninja_jumble.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ninja_jumble.cc b/src/ninja_jumble.cc
index a935c21..dc7c4a2 100644
--- a/src/ninja_jumble.cc
+++ b/src/ninja_jumble.cc
@@ -24,6 +24,7 @@
#include "build_log.h"
#include "graph.h"
+#include "util.h"
int ReadFile(const string& path, string* contents, string* err) {
FILE* f = fopen(path.c_str(), "r");
@@ -53,7 +54,7 @@ int RealDiskInterface::Stat(const string& path) {
if (errno == ENOENT) {
return 0;
} else {
- fprintf(stderr, "stat(%s): %s\n", path.c_str(), strerror(errno));
+ Error("stat(%s): %s", path.c_str(), strerror(errno));
return -1;
}
}
@@ -100,7 +101,7 @@ string RealDiskInterface::ReadFile(const string& path, string* err) {
bool RealDiskInterface::MakeDir(const string& path) {
if (mkdir(path.c_str(), 0777) < 0) {
- fprintf(stderr, "mkdir(%s): %s\n", path.c_str(), strerror(errno));
+ Error("mkdir(%s): %s", path.c_str(), strerror(errno));
return false;
}
return true;
@@ -178,8 +179,8 @@ void State::AddOut(Edge* edge, const string& path) {
Node* node = GetNode(path);
edge->outputs_.push_back(node);
if (node->in_edge_) {
- fprintf(stderr, "WARNING: multiple rules generate %s. "
- "build will not be correct; continuing anyway\n", path.c_str());
+ Error("WARNING: multiple rules generate %s. "
+ "build will not be correct; continuing anyway", path.c_str());
}
node->in_edge_ = edge;
}