Example #1
0
int
Program::ExecuteAndWait(const Path& path,
                        const char** args,
                        const char** envp,
                        const Path** redirects,
                        unsigned secondsToWait,
                        unsigned memoryLimit,
                        std::string* ErrMsg,
                        bool *ExecutionFailed) {
    Program prg;
    if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg)) {
        if (ExecutionFailed) *ExecutionFailed = false;
        return prg.Wait(path, secondsToWait, ErrMsg);
    }
    if (ExecutionFailed) *ExecutionFailed = true;
    return -1;
}
Example #2
-1
int
Program::ExecuteAndWait(const Path& path,
                        const char** args,
                        const char** envp,
                        const Path** redirects,
                        unsigned secondsToWait,
                        unsigned memoryLimit,
                        std::string* ErrMsg) {
  Program prg;
  if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg))
    return prg.Wait(path, secondsToWait, ErrMsg);
  else
    return -1;
}