summaryrefslogtreecommitdiff
path: root/tools/hi-q.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-14 21:28:06 (GMT)
committerJohn Denker <jsd@av8n.com>2012-07-14 21:28:06 (GMT)
commit2ea78688f2a8189cad8766df4859e2dad8d14486 (patch)
treeb9edf2103c33220f1691067d3bbf0ca2e72047b6 /tools/hi-q.c
parent1177b12fbc82bfa0aef3ebd761bd4d715dd72cbd (diff)
make 64-bit clean; add some progress messages
Diffstat (limited to 'tools/hi-q.c')
-rw-r--r--tools/hi-q.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/hi-q.c b/tools/hi-q.c
index 32b0a7b..8f0fb93 100644
--- a/tools/hi-q.c
+++ b/tools/hi-q.c
@@ -327,12 +327,14 @@ int main(int argc, char** argv, char const * const * env) {
//xx fprintf(stderr, "slurping %d %d\n", 1, loose_end);
-// All is well.
+// All filters agree this is not spam.
// Now it is safe to transfer the envelope information:
slurp(1, loose_end);
close(1);
close(loose_end);
+// now that the envelope information has been transfered,
+// wait for the last kid in the usual way
{
int ii = nkids-1;
@@ -342,12 +344,17 @@ fprintf(stderr, "About to wait for kid #%d (%d)\n",
blurb(nkids-1, kidpid);
#endif
somekid = waitpid(kidpid[ii], &kidstatus, WUNTRACED);
- if (WIFEXITED(kidstatus)) return WEXITSTATUS(kidstatus);
+ if (WIFEXITED(kidstatus)) {
+ int sts = WEXITSTATUS(kidstatus);
+ cerr << "hi-q ends with status: " << sts << endl;
+ return sts;
+ }
}
#ifdef testing
sleep(1);
#endif
- return ex_syserr; // any kill, not a normal exit
+// the last kid did not exit but was killed:
+ return ex_syserr;
}