summaryrefslogtreecommitdiff
path: root/tools/hi-q.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-21 22:53:08 (GMT)
committerJohn Denker <jsd@av8n.com>2012-07-21 22:53:08 (GMT)
commit178786bb76b9fdba550de3a49a159da6515931cc (patch)
treef1684261c1f9f542277107e0741d79c34bb199d3 /tools/hi-q.c
parent0abfc69e469b5bf40a0531c0ae2f166a9fabbb36 (diff)
ignore penalty features for the moment
Diffstat (limited to 'tools/hi-q.c')
-rw-r--r--tools/hi-q.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/tools/hi-q.c b/tools/hi-q.c
index 6aaf302..8766b08 100644
--- a/tools/hi-q.c
+++ b/tools/hi-q.c
@@ -158,7 +158,7 @@ int fork_and_wait(const jobber job){
int sts = WEXITSTATUS(kidstatus);
if (sts != ex_good && sts != ex_spam) {
cerr << "hi-q: job " << prog[0]
- << " unexpectedly returns status: " << sts
+ << " unexpectedly returns status: " << sts
<< endl;
exit(sts);
}
@@ -179,7 +179,7 @@ int fork_and_wait(const jobber job){
int fork_and_wait(vector<jobber> post){
for(vector<jobber>::const_iterator foo = post.begin();
foo != post.end(); foo++) {
- int rslt = fork_and_wait(*foo);
+ int rslt = fork_and_wait(*foo);
if (rslt) return rslt;
}
return 0;
@@ -590,7 +590,7 @@ bar
// do not decrement the "alive" counter
// since that only applies to non-special kids
if (WIFEXITED(kidstatus)) {
- cerr << "hi-q: special kid exited early, status "
+ cerr << "hi-q: special kid exited early, status "
<< WEXITSTATUS(kidstatus)
<< " with " << alive << " kids still alive"
<< endl;
@@ -599,10 +599,10 @@ bar
int sig = WTERMSIG(kidstatus);
if (sig == SIGUSR1) {/* normal, no logging required */}
else {
- cerr << "hi-q: special kid killed by signal "
+ cerr << "hi-q: special kid killed by signal "
<< sig << endl;
// this is not normal
- return(ex_syserr);
+ return(ex_syserr);
}
} else {
/* paused, not dead */
@@ -612,7 +612,13 @@ bar
// here if somekid is not the special kid
if (WIFEXITED(kidstatus)) {
alive--;
- if (WEXITSTATUS(kidstatus)) {
+ int sts = WEXITSTATUS(kidstatus);
+#ifndef PENALIZE_SPAMMERS
+ // ignore penalties for the moment
+ // to see whether there are any false positives
+ if (sts == ex_penaltybox) sts = ex_good;
+#endif
+ if (sts) {
argbest_blame = somekid;
best_blame = kidstatus;
break;
@@ -694,7 +700,7 @@ bar
if (WIFEXITED(kidstatus)) {
int sts = WEXITSTATUS(kidstatus);
cerr << progid
- << " says: qq program"
+ << " says: qq program"
<< " i.e. " << basename(filter[nkids-1].cmd[0])
<< "[" << kidpid[nkids-1] << "]"
<< " returned status " << sts
@@ -702,7 +708,7 @@ bar
return sts;
} else if (WIFSIGNALED(kidstatus)) {
cerr << progid
- << " says: qq program"
+ << " says: qq program"
<< " i.e. " << basename(filter[nkids-1].cmd[0])
<< "[" << kidpid[nkids-1] << "]"
<< " was killed by signal " << WTERMSIG(kidstatus)