summaryrefslogtreecommitdiffstats
path: root/src/browse.cc
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2011-04-09 17:51:21 (GMT)
committerNicolas Despres <nicolas.despres@gmail.com>2011-04-26 11:20:08 (GMT)
commitb471f2db6e79abeda1717f3f136bc369eb916958 (patch)
treecf2dd6e35c99125e25e46b78e46dcdfff9053712 /src/browse.cc
parent5c192cda0788faeed93b3ba03a6830ed43762b24 (diff)
downloadNinja-b471f2db6e79abeda1717f3f136bc369eb916958.zip
Ninja-b471f2db6e79abeda1717f3f136bc369eb916958.tar.gz
Ninja-b471f2db6e79abeda1717f3f136bc369eb916958.tar.bz2
Prefix perror(3) messages with program name.
It make it easier while debugging to know who is reporting the error: Ninja itself or one of the command called by Ninja during the build process or one of the generator which called Ninja.
Diffstat (limited to 'src/browse.cc')
-rw-r--r--src/browse.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/browse.cc b/src/browse.cc
index db89db0..f65e537 100644
--- a/src/browse.cc
+++ b/src/browse.cc
@@ -25,13 +25,13 @@ void RunBrowsePython(State* state, const char* ninja_command) {
// (Actually the Python process becomes the parent.)
int pipefd[2];
if (pipe(pipefd) < 0) {
- perror("pipe");
+ perror("ninja: pipe");
return;
}
pid_t pid = fork();
if (pid < 0) {
- perror("fork");
+ perror("ninja: fork");
return;
}
@@ -39,7 +39,7 @@ void RunBrowsePython(State* state, const char* ninja_command) {
close(pipefd[1]);
do {
if (dup2(pipefd[0], 0) < 0) {
- perror("dup2");
+ perror("ninja: dup2");
break;
}
@@ -48,7 +48,7 @@ void RunBrowsePython(State* state, const char* ninja_command) {
"python", "-", ninja_command, NULL
};
execvp(command[0], (char**)command);
- perror("execvp");
+ perror("ninja: execvp");
} while (false);
_exit(1);
} else { // Child.
@@ -57,7 +57,7 @@ void RunBrowsePython(State* state, const char* ninja_command) {
// Write the script file into the stdin of the Python process.
ssize_t len = write(pipefd[1], kBrowsePy, sizeof(kBrowsePy));
if (len < (ssize_t)sizeof(kBrowsePy))
- perror("write");
+ perror("ninja: write");
close(pipefd[1]);
exit(0);
}