21 #include <sys/types.h> 23 #include "jobabstract.h" 27 JobAbstract::JobAbstract(ExecutablePtr &executable) :
28 m_executable(executable),
33 JobAbstract::~JobAbstract()
37 void JobAbstract::captureStdin()
42 void JobAbstract::setOutputFile(
const std::string &path)
44 mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
45 m_stdout[1] = m_stderr[1] = ::open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, mode);
46 log_debug() <<
"stdout/stderr redirected to " << path <<
" fd:" << m_stdout[0];
49 void JobAbstract::captureStdout()
54 void JobAbstract::captureStderr()
59 int JobAbstract::wait()
65 int JobAbstract::stdout()
70 int JobAbstract::stderr()
75 int JobAbstract::stdin()
80 pid_t JobAbstract::pid()
87 if (0 == m_exitStatus) {
109 void JobAbstract::setEnvironmentVariable(
const std::string &key,
const std::string &value)
114 void JobAbstract::setEnvironmentVariables(
const EnvironmentVariables &env)
bool isRunning()
That method always returns true as soon as the start() method has been called, even if the command fa...
int waitForProcessTermination(pid_t pid)
waitForProcessTermination Waits for a process to terminate and then returns the status of the process...
Developers guide to adding a config item:
bool isSuccess()
Helper about return value of jobs.
bool isError()
Helper about return value of jobs.