diff options
author | Oz Linden <oz@lindenlab.com> | 2012-06-08 12:09:45 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-06-08 12:09:45 -0400 |
commit | 32943b1d99a07668ddcb6875cb3cd62ac8341414 (patch) | |
tree | a0f01118ffd99e2af8da46eeeaabfb38fa8ad46d /indra/llcommon/llprocess.cpp | |
parent | 3ebfcd70542b29bd709fc08860eb06f211e2fa6a (diff) | |
parent | bd2587508ed66c5ef0332758cb2cae2d05a8908e (diff) |
merge changes for DRTVWR-164
Diffstat (limited to 'indra/llcommon/llprocess.cpp')
-rw-r--r-- | indra/llcommon/llprocess.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 9667e4e033..715df36f39 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -819,16 +819,43 @@ bool LLProcess::kill(const std::string& who) return ! isRunning(); } +//static +bool LLProcess::kill(const LLProcessPtr& p, const std::string& who) +{ + if (! p) + return true; // process dead! (was never running) + return p->kill(who); +} + bool LLProcess::isRunning() const { return getStatus().mState == RUNNING; } +//static +bool LLProcess::isRunning(const LLProcessPtr& p) +{ + if (! p) + return false; + return p->isRunning(); +} + LLProcess::Status LLProcess::getStatus() const { return mStatus; } +//static +LLProcess::Status LLProcess::getStatus(const LLProcessPtr& p) +{ + if (! p) + { + // default-constructed Status has mState == UNSTARTED + return Status(); + } + return p->getStatus(); +} + std::string LLProcess::getStatusString() const { return getStatusString(getStatus()); @@ -840,6 +867,17 @@ std::string LLProcess::getStatusString(const Status& status) const } //static +std::string LLProcess::getStatusString(const std::string& desc, const LLProcessPtr& p) +{ + if (! p) + { + // default-constructed Status has mState == UNSTARTED + return getStatusString(desc, Status()); + } + return desc + " " + p->getStatusString(); +} + +//static std::string LLProcess::getStatusString(const std::string& desc, const Status& status) { if (status.mState == UNSTARTED) |