summaryrefslogtreecommitdiff
path: root/tools/hi-test.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-15 19:11:15 (GMT)
committerJohn Denker <jsd@av8n.com>2012-07-15 19:13:13 (GMT)
commit827bfdd5050bda8ad8954d8231e7836dd7aac867 (patch)
treecde67ea6b18a12f34b2341dc9fbdaeddb581212c /tools/hi-test.c
parentffc4b5ce605253957b2a0ce82cf924c669806590 (diff)
allow filters to terminate in arbitrary order;
report best blame (not first blame)
Diffstat (limited to 'tools/hi-test.c')
-rw-r--r--tools/hi-test.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/hi-test.c b/tools/hi-test.c
index 50e4a76..0c9a35f 100644
--- a/tools/hi-test.c
+++ b/tools/hi-test.c
@@ -44,6 +44,7 @@ using namespace std;
int main(int _argc, const char** _argv){
int snooze(0);
int status(0);
+ int killmode(0);
int argc(_argc);
const char **argv(_argv);
string progname(*argv); argv++; argc--;
@@ -62,14 +63,18 @@ int main(int _argc, const char** _argv){
snooze = atoi(*argv); argv++; argc--;
continue;
}
- if (prefix(arg, "-kill")) {
+ if (prefix(arg, "-exit")) {
if (!argc) {
- cerr << "Option -kill requires an argument" << endl;
+ cerr << "Option -exit requires an argument" << endl;
exit(sa_usage);
}
status = atoi(*argv); argv++; argc--;
continue;
}
+ if (prefix(arg, "-kill")) {
+ killmode++;
+ continue;
+ }
if (arg.substr(0,1) == "x") {
continue;
}
@@ -83,12 +88,12 @@ int main(int _argc, const char** _argv){
exit(sa_usage);
}
}
-
cerr << "++++ hi-test pid: " << getpid() << " group: " << getpgid(0);
char* foo = getenv("HI_Q_GROUP");
if (foo) cerr << " HI_Q_GROUP: " << foo;
cerr << endl;
sleep(snooze);
- exeunt(status);
+ if (killmode) exeunt(status);
+ exit(status);
}