diff options
author | randomdan <randomdan@localhost> | 2014-01-10 21:37:46 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2014-01-10 21:37:46 +0000 |
commit | 73eb737f5da7a209ed038b0c27a788595a652617 (patch) | |
tree | 020b59a0e888476cac6181296f1240f6b94b035f /project2/processes/processStream.cpp | |
parent | Remove boost::format bloat by centralizeing construction (diff) | |
download | project2-73eb737f5da7a209ed038b0c27a788595a652617.tar.bz2 project2-73eb737f5da7a209ed038b0c27a788595a652617.tar.xz project2-73eb737f5da7a209ed038b0c27a788595a652617.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.cpp | 9 |
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); |