summaryrefslogtreecommitdiff
path: root/tools/hi-q.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-19 21:56:22 (GMT)
committerJohn Denker <jsd@av8n.com>2012-07-19 21:56:22 (GMT)
commit067dd9a68045bf775e02a47fbf663b73c6d28901 (patch)
tree1eacaebd7eb595bfcafb2c447eb1607d274a550c /tools/hi-q.c
parent6710e3d72bfa36de6ef0cfb0bdd9623c65ebc40f (diff)
log some interesting variables
Diffstat (limited to 'tools/hi-q.c')
-rw-r--r--tools/hi-q.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/hi-q.c b/tools/hi-q.c
index 6140206..2ddc448 100644
--- a/tools/hi-q.c
+++ b/tools/hi-q.c
@@ -120,11 +120,16 @@ void usage() {
// we have data coming in on fd 0.
// and envelope / control information coming in on fd 1.
+string progname;
+pid_t mypid;
+
void dump(const string var){
char* str = getenv(var.c_str());
- if (str) cerr << "hi-q: " << var
- << " is set to '" << str << "'" << endl;
- else cerr << "hi-q: " << var << " is not set." << endl;
+ cerr << progname
+ << "[" << mypid << "] "
+ << var;
+ if (str) cerr << " is set to '" << str << "'" << endl;
+ else cerr << " is not set." << endl;
}
int xclose(int arg){
@@ -149,7 +154,7 @@ public:
: mode(fail), cmd(_cmd){
setmode(_mode);
}
-
+
jobber()
: mode(fail), cmd(0)
{}
@@ -168,6 +173,10 @@ public:
};
int main(int argc, char** argv) {
+ progname = *argv;
+ mypid = getpid();
+ dump("TCPREMOTEIP");
+ dump("TCPREMOTEHOST");
int verbose(0);
int kidstatus;
@@ -534,7 +543,7 @@ int main(int argc, char** argv) {
int sts = WEXITSTATUS(kidstatus);
cerr << "hi-q says: qq program " << kidpid[nkids-1]
<< " i.e. '" << filter[nkids-1].cmd[0] << "'"
- << " returned status " << sts
+ << " returned status " << sts
<< endl;
return sts;
} else if (WIFSIGNALED(kidstatus)) {