summaryrefslogtreecommitdiff
path: root/project2/processes/processStream.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2014-01-10 21:37:46 +0000
committerrandomdan <randomdan@localhost>2014-01-10 21:37:46 +0000
commitf2284fe4cccce04557da9e1c12c3d989f5ee6b37 (patch)
tree020b59a0e888476cac6181296f1240f6b94b035f /project2/processes/processStream.cpp
parentRemove boost::format bloat by centralizeing construction (diff)
downloadproject2-f2284fe4cccce04557da9e1c12c3d989f5ee6b37.tar.bz2
project2-f2284fe4cccce04557da9e1c12c3d989f5ee6b37.tar.xz
project2-f2284fe4cccce04557da9e1c12c3d989f5ee6b37.zip
Improvements to popenrw and add popenrwe for the stderr pipe too
Improve exception when loading a library fails Fix a handful of ingeniously located memory leaks
Diffstat (limited to 'project2/processes/processStream.cpp')
-rw-r--r--project2/processes/processStream.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/project2/processes/processStream.cpp b/project2/processes/processStream.cpp
index f2c678f..1ed8388 100644
--- a/project2/processes/processStream.cpp
+++ b/project2/processes/processStream.cpp
@@ -23,13 +23,12 @@ class ProcessStream : public Stream, IHaveParameters {
void runStream(const Sink & sink, ExecContext * ec) const
{
- const char * callProc[parameters.size() + 2];
- callProc[0] = path(ec);
- int pidx = 1;
+ std::vector<std::string> callProc;
+ callProc.reserve(parameters.size() + 2);
+ callProc.push_back(path(ec));
BOOST_FOREACH(const Parameters::value_type & p, parameters) {
- callProc[pidx++] = p.second(ec);
+ callProc.push_back(p.second(ec));
}
- callProc[pidx] = NULL;
int fds[2];
popenrw(callProc, fds);