summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-23 14:52:21 -0700
committerJohn Denker <jsd@av8n.com>2012-07-23 14:52:21 -0700
commit41e42ef31bf7c7d3f290e662a3b4bbb5c9abb68d (patch)
treed080a74b022148544b241d43d9438d054316a253
parentc5f90db88ef7c9b9055d81266a124699ac47971d (diff)
more minor polishing
-rw-r--r--tools/hi-q.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/tools/hi-q.c b/tools/hi-q.c
index d267d2c..502de69 100644
--- a/tools/hi-q.c
+++ b/tools/hi-q.c
@@ -527,13 +527,13 @@ bar
}
// figure out the intended bindings:
- int pardang1(-1), pardang2(-1); // used by current kid,
- // but dangling, from parent's point of view
+ list<int> pardang;
switch (filter[ii].mode) {
case sa:
case series:
- pardang1 = current_write[MSG] = datapipe[wEnd];
- pardang2 = current_read[MSG];
+ current_write[MSG] = datapipe[wEnd];
+ pardang.push_back(current_write[MSG]);
+ pardang.push_back(current_read[MSG]);
next_read[MSG] = datapipe[rEnd];
break;
case qq:
@@ -541,7 +541,8 @@ bar
cerr << "???? multiple qq jobs?" << endl;
}
slurp_write= datapipe[wEnd];
- pardang1 = current_read[ENV] = datapipe[rEnd];
+ current_read[ENV] = datapipe[rEnd];
+ pardang.push_back(current_read[ENV]);
next_read[ENV] = -1;
next_read[MSG] = -1;
current_write[ENV] = -1;
@@ -672,13 +673,13 @@ bar
close(current_write[MSG]);
close(current_write[ENV]);
close(current_read[ENV]);
- if (0) cerr << "closing " << pardang1
- << " for parent of " << kidid << endl;
+ for (LI::const_iterator ptr = pardang.begin();
+ ptr != pardang.end(); ptr++) {
+ if (0) cerr << "closing " << *ptr
+ << " for parent of " << kidid << endl;
- close(pardang1);
- if (0) cerr << "closing " << pardang2
- << " for parent of " << kidid << endl;
- close(pardang2);
+ close(*ptr);
+ }
// Let kid #0 run a little ways:
if (ii==0) {