summaryrefslogtreecommitdiff
path: root/tests/Naming_Test.cpp
diff options
context:
space:
mode:
authorelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-05-16 14:01:12 +0000
committerelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-05-16 14:01:12 +0000
commitd680cedcfec814c87cb0ce55355fcd6af769274c (patch)
tree97a51f402a0a9d2743fb38e3591b31e92d0004dc /tests/Naming_Test.cpp
parent5ba11d82a0617ef7fa69b2a1d11f50e171754438 (diff)
downloadATCD-d680cedcfec814c87cb0ce55355fcd6af769274c.tar.gz
ChangeLogTag: Mon May 16 09:01:07 2005 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'tests/Naming_Test.cpp')
-rw-r--r--tests/Naming_Test.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Naming_Test.cpp b/tests/Naming_Test.cpp
index 04b76992dfc..50b6a9ec500 100644
--- a/tests/Naming_Test.cpp
+++ b/tests/Naming_Test.cpp
@@ -200,6 +200,22 @@ run_main (int argc, ACE_TCHAR *argv[])
}
else
{
+ // Allow the user to determine where the context file will be
+ // located just in case the current directory is not suitable for
+ // locking. We don't just set namespace_dir () on name_options
+ // because that is not sufficient to work around locking problems
+ // for Tru64 when the current directory is NFS mounted from a
+ // system that does not properly support locking.
+ const char* temp_envs[] = { "TMPDIR", "TEMP", "TMP", 0 };
+ for(const char** temp_env = temp_envs; *temp_env != 0; ++temp_env)
+ {
+ char* temp_dir = ACE_OS::getenv(*temp_env);
+ if (temp_dir != 0)
+ {
+ ACE_OS::chdir (temp_dir);
+ break;
+ }
+ }
ACE_OS::strcpy (temp_file, ACE::basename (name_options->process_name (),
ACE_DIRECTORY_SEPARATOR_CHAR));
ACE_OS::strcat (temp_file, ACE_TEXT ("XXXXXX"));