diff options
Diffstat (limited to 'tools')
-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 |