summaryrefslogtreecommitdiff
path: root/indra/llcommon/tests/llprocess_test.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-01-30 12:11:44 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-01-30 12:11:44 -0500
commit85581eefa63d8f8e8c5132c4cd7e137f6cb88869 (patch)
treefa1d771b9e4cf86bc125f0b5cd5c7d8f41a65e80 /indra/llcommon/tests/llprocess_test.cpp
parent803acbc5efde19c0acacfc7fe4990841dbf31a3e (diff)
Expose 'handle' as well as 'id' on LLProcess objects.
On Posix, these and the corresponding getProcessID()/getProcessHandle() accessors produce the same pid_t value; but on Windows, it's useful to distinguish an int-like 'id' useful to human log readers versus an opaque 'handle' for passing to platform-specific API functions. So make the distinction in a platform-independent way.
Diffstat (limited to 'indra/llcommon/tests/llprocess_test.cpp')
-rw-r--r--indra/llcommon/tests/llprocess_test.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index 405540e436..4ad45bdf27 100644
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -599,7 +599,7 @@ namespace tut
{
set_test_name("implicit kill()");
NamedTempFile out("out", "not started");
- LLProcess::id pid(0);
+ LLProcess::handle phandle(0);
{
PythonProcessLauncher py("kill()",
"from __future__ import with_statement\n"
@@ -614,8 +614,8 @@ namespace tut
py.mParams.args.add(out.getName());
py.mPy = LLProcess::create(py.mParams);
ensure("couldn't launch kill() script", py.mPy);
- // Capture id for later
- pid = py.mPy->getProcessID();
+ // Capture handle for later
+ phandle = py.mPy->getProcessHandle();
// Wait for the script to wake up and do its first write
int i = 0, timeout = 60;
for ( ; i < timeout; ++i)
@@ -630,7 +630,7 @@ namespace tut
// Destroy the LLProcess, which should kill the child.
}
// wait for the script to terminate... one way or another.
- while (LLProcess::isRunning(pid))
+ while (LLProcess::isRunning(phandle))
{
sleep(1);
}
@@ -646,7 +646,7 @@ namespace tut
set_test_name("autokill");
NamedTempFile from("from", "not started");
NamedTempFile to("to", "");
- LLProcess::id pid(0);
+ LLProcess::handle phandle(0);
{
PythonProcessLauncher py("autokill",
"from __future__ import with_statement\n"
@@ -672,8 +672,8 @@ namespace tut
py.mParams.autokill = false;
py.mPy = LLProcess::create(py.mParams);
ensure("couldn't launch kill() script", py.mPy);
- // Capture id for later
- pid = py.mPy->getProcessID();
+ // Capture handle for later
+ phandle = py.mPy->getProcessHandle();
// Wait for the script to wake up and do its first write
int i = 0, timeout = 60;
for ( ; i < timeout; ++i)
@@ -695,7 +695,7 @@ namespace tut
outf << "go";
} // flush and close.
// now wait for the script to terminate... one way or another.
- while (LLProcess::isRunning(pid))
+ while (LLProcess::isRunning(phandle))
{
sleep(1);
}