diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-02-20 12:40:38 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-02-20 12:40:38 -0500 |
commit | 8b5d5f9652499103b966524e1c0ceef869e29eeb (patch) | |
tree | ec05ac1af57eea5d1f1d5a4b7a336be0a2a83e39 /indra/llcommon/llprocess.h | |
parent | e98438bda70f92c1caa0621b7e467b72c7e484ad (diff) |
Make LLProcess post termination event to specified pump if desired.
This way a caller need not spin on isRunning(); we can just listen for the
requested termination event.
Post a similar event containing error message if for any reason
LLProcess::create() failed to launch the child.
Add unit tests for both cases.
Diffstat (limited to 'indra/llcommon/llprocess.h')
-rw-r--r-- | indra/llcommon/llprocess.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index 06be0954c0..96a3dce5b3 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -158,7 +158,8 @@ public: args("args"), cwd("cwd"), autokill("autokill", true), - files("files") + files("files"), + postend("postend") {} /// pathname of executable @@ -184,6 +185,20 @@ public: * underlying implementation library doesn't support that. */ Multiple<FileParam> files; + /** + * On child-process termination, if this LLProcess object still + * exists, post LLSD event to LLEventPump with specified name (default + * no event). Event contains at least: + * + * - "id" as obtained from getProcessID() + * - "desc" short string description of child (executable + pid) + * - "state" @c state enum value, from Status.mState + * - "data" if "state" is EXITED, exit code; if KILLED, on Posix, + * signal number + * - "string" English text describing "state" and "data" (e.g. "exited + * with code 0") + */ + Optional<std::string> postend; }; typedef LLSDParamAdapter<Params> LLSDOrParams; @@ -462,6 +477,7 @@ private: PIPETYPE* getPipePtr(std::string& error, FILESLOT slot); std::string mDesc; + std::string mPostend; apr_proc_t mProcess; bool mAutokill; Status mStatus; |