diff options
author | John Denker <jsd@av8n.com> | 2012-07-23 14:52:21 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2012-07-29 15:32:36 -0700 |
commit | 3993d2f92fc1d357ee668d42cbb44aa3744e6d2c (patch) | |
tree | 75001bc2d6fd509efbe7041f4e7792f84d671c95 /tools | |
parent | 41552786cd6dee05e8cdc20c2daaf5127ec8cb9f (diff) |
more minor polishing
Diffstat (limited to 'tools')
-rw-r--r-- | tools/hi-q.c | 23 |
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) { |