File src/integration.cpp changed (mode: 100644) (index df6dfbb..08306e2) |
... |
... |
readProc(std::vector<std::string> &&cmd, const std::string &dir, |
303 |
303 |
* |
* |
304 |
304 |
* @returns Exit code and output of the command. |
* @returns Exit code and output of the command. |
305 |
305 |
* |
* |
306 |
|
* @throws std::runtime_error On failure to run the command or when it didn't |
|
307 |
|
* finish properly. |
|
|
306 |
|
* @throws std::runtime_error On empty command, failure to run it or when it |
|
307 |
|
* didn't finish properly. |
308 |
308 |
*/ |
*/ |
309 |
309 |
static ProcResult |
static ProcResult |
310 |
310 |
runProc(std::vector<std::string> &&cmd, const std::string &dir, |
runProc(std::vector<std::string> &&cmd, const std::string &dir, |
311 |
311 |
CatchStderr catchStdErr) |
CatchStderr catchStdErr) |
312 |
312 |
{ |
{ |
|
313 |
|
if (cmd.empty()) { |
|
314 |
|
throw std::runtime_error("Attempt to run an empty command"); |
|
315 |
|
} |
|
316 |
|
|
313 |
317 |
int pipePair[2]; |
int pipePair[2]; |
314 |
318 |
if (pipe(pipePair) != 0) { |
if (pipe(pipePair) != 0) { |
315 |
319 |
throw std::runtime_error("Failed to create a pipe"); |
throw std::runtime_error("Failed to create a pipe"); |