diff options
author | John Denker <jsd@av8n.com> | 2012-07-14 16:19:30 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2012-07-14 16:19:30 -0700 |
commit | 96906a8d4c0b9942d94c6bf01c68b05de827e947 (patch) | |
tree | 3cc390087be35549a19ea3831bcd585f32ba8ef2 | |
parent | 7fbe472c452717e4e5d08cd5905184012d788c0a (diff) |
more progress/results reporting
-rw-r--r-- | tools/hi-q.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/hi-q.c b/tools/hi-q.c index 8f0fb93..a065ad0 100644 --- a/tools/hi-q.c +++ b/tools/hi-q.c @@ -309,15 +309,26 @@ int main(int argc, char** argv, char const * const * env) { for (int ii=0; ii<nkids-1; ii++){ /* loop over N-1 kids */ /* not last kid */ - #ifdef testing blurb(ii, kidpid); #else somekid = waitpid(kidpid[ii], &kidstatus, WUNTRACED); if (somekid) {} // avoid silly compiler warning if (WIFEXITED(kidstatus)) { - if (WEXITSTATUS(kidstatus) == 1) panic(ex_spam); - if (WEXITSTATUS(kidstatus) != 0) panic(ex_syserr); + int sts = WEXITSTATUS(kidstatus); + if (sts == 1) { + cerr << "hi-q says: kid " << ii + << " i.e. '" << filter[ii][0] << "' reports spam." + << endl; + panic(ex_spam); + } + if (sts != 0) { + cerr << "hi-q says: kid " << ii + << " i.e. '" << filter[ii][0] << "'" + << " suffered an error: " << sts + << endl; + panic(ex_syserr); + } /* otherwise kidstatus==0 and we fall through */ } else panic(ex_syserr); // any kill, not a normal exit |