diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-10-11 00:45:19 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1998-10-11 00:45:19 +0000 |
commit | a9bf571972ac2c5eee629ef061437f5a41090fde (patch) | |
tree | 1f09df5ac1ebfbf4309b5fb9751cb4bfb859f44d /ace/Mem_Map.cpp | |
parent | 9b71450b19be4d024fbfc9a90c2ab136e53002a1 (diff) | |
download | ATCD-a9bf571972ac2c5eee629ef061437f5a41090fde.tar.gz |
.
Diffstat (limited to 'ace/Mem_Map.cpp')
-rw-r--r-- | ace/Mem_Map.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/ace/Mem_Map.cpp b/ace/Mem_Map.cpp index e7d290d9ba0..786dd566965 100644 --- a/ace/Mem_Map.cpp +++ b/ace/Mem_Map.cpp @@ -89,16 +89,16 @@ ACE_Mem_Map::map_it (ACE_HANDLE handle, this->length_ = len_request; } else - { - // Set length to file_request - this->length_ = file_len; - } + // Set length to file_request + this->length_ = file_len; - if (extend_backing_store) + if (extend_backing_store // Extend the backing store. - if (ACE_OS::pwrite (this->handle_, "", 1, - this->length_ > 0 ? this->length_ - 1 : 0) == -1) - return -1; + && ACE_OS::pwrite (this->handle_, + "", + 1, + this->length_ > 0 ? this->length_ - 1 : 0) == -1) + return -1; #if defined (__Lynx__) // Set flag that indicates whether PROT_WRITE has been enabled. @@ -125,9 +125,15 @@ ACE_Mem_Map::open (LPCTSTR file_name, { ACE_TRACE ("ACE_Mem_Map::open"); - ACE_OS::strncpy (this->filename_, file_name, MAXPATHLEN); + ACE_OS::strncpy (this->filename_, + file_name, + MAXPATHLEN); +#if defined (CHORUS) + this->handle_ = ACE_OS::shm_open (file_name, flags, mode, sa); +#else this->handle_ = ACE_OS::open (file_name, flags, mode, sa); +#endif /* CHORUS */ if (this->handle_ == ACE_INVALID_HANDLE) return -1; @@ -226,7 +232,12 @@ ACE_Mem_Map::remove (void) this->close (); if (this->filename_[0] != '\0') - return ACE_OS::unlink (this->filename_); +#if defined (CHORUS) + return ACE_OS::shm_unlink (this->filename_); +#else + return ACE_OS::unlink (this->filename_); +#endif /* CHORUS */ + else return 0; } |