示例#1
0
文件: Program.cpp 项目: hugwijst/lbd
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;
}
示例#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;
}