aboutsummaryrefslogtreecommitdiff
path: root/exec.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-24 22:27:48 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-25 17:51:01 +0900
commit5e9def34c7c527406f9e60ec162a7a6fcc9a30c4 (patch)
treec799c6e7c671e8396f598feec26d312922c26cf9 /exec.cc
parent70bbc4d783441ad6699cdd3960e16cc3a1d56270 (diff)
downloadkati-5e9def34c7c527406f9e60ec162a7a6fcc9a30c4.tar.gz
[C++] Fix silent_ignore_error.mk
Diffstat (limited to 'exec.cc')
-rw-r--r--exec.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/exec.cc b/exec.cc
index 79e6102..8035965 100644
--- a/exec.cc
+++ b/exec.cc
@@ -160,7 +160,17 @@ class Executor {
printf("%s\n", runner->cmd->c_str());
fflush(stdout);
}
- system(runner->cmd->c_str());
+ int result = system(runner->cmd->c_str());
+ if (result != 0) {
+ if (runner->ignore_error) {
+ fprintf(stderr, "[%.*s] Error %d (ignored)\n",
+ SPF(runner->output), WEXITSTATUS(result));
+ } else {
+ fprintf(stderr, "*** [%.*s] Error %d\n",
+ SPF(runner->output), WEXITSTATUS(result));
+ exit(1);
+ }
+ }
delete runner;
}
}