diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-28 19:41:17 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-02-28 19:41:17 +0000 |
commit | 71b7d0e8aa65fb36fcee927cac4a102ac28ee0a2 (patch) | |
tree | 520e9727457223d12bb10a84244636523f7b4a40 /ace/FILE_Addr.cpp | |
parent | 0d9d1ef62a88b42f2eab7206482b3ae32d931b81 (diff) | |
download | ATCD-71b7d0e8aa65fb36fcee927cac4a102ac28ee0a2.tar.gz |
ChangeLogTag:Mon Feb 28 09:20:27 2000 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'ace/FILE_Addr.cpp')
-rw-r--r-- | ace/FILE_Addr.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ace/FILE_Addr.cpp b/ace/FILE_Addr.cpp index 17e90a1ed48..82507169448 100644 --- a/ace/FILE_Addr.cpp +++ b/ace/FILE_Addr.cpp @@ -22,9 +22,25 @@ ACE_FILE_Addr::set (const ACE_FILE_Addr &sa) { if (sa.get_type () == AF_ANY) { +#if defined (ACE_DEFAULT_TEMP_FILE) // Create a temporary file. ACE_OS::strcpy (this->filename_, ACE_DEFAULT_TEMP_FILE); +#else /* ACE_DEFAULT_TEMP_FILE */ + if (ACE::get_temp_dir (this->filename_, + MAXPATHLEN - 15) == -1) // -15 for ace-file-XXXXXX + { + ACE_ERROR ((LM_ERROR, + "Temporary path too long, " + "defaulting to current directory\n")); + this->filename_[0] = 0; + } + + // Add the filename to the end + ACE_OS::strcat (this->filename_, ACE_TEXT ("ace-file-XXXXXX")); + +#endif /* ACE_DEFAULT_TEMP_FILE */ + ACE_OS::mktemp (this->filename_); this->base_set (AF_FILE, ACE_OS::strlen (this->filename_) + 1); |