summaryrefslogtreecommitdiff
path: root/ace/Memory_Pool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Memory_Pool.cpp')
-rw-r--r--ace/Memory_Pool.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp
index 4f0082d5725..14577fd867c 100644
--- a/ace/Memory_Pool.cpp
+++ b/ace/Memory_Pool.cpp
@@ -665,14 +665,17 @@ ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool (LPCTSTR backing_store_name,
// Convert the string into a number that is used as the segment
// key.
+ int segment_key;
int result = ::sscanf (backing_store_name,
"%d",
- &this->base_shm_key_);
+ &segment_key);
if (result == 0 || result == EOF)
// The conversion to a number failed so hash with crc32
// ACE::crc32 is also used in <SV_Semaphore_Simple>.
this->base_shm_key_ = (key_t) ACE::crc32 (backing_store_name);
+ else
+ this->base_shm_key_ = segment_key;
if (this->base_shm_key_ == IPC_PRIVATE)
// Make sure that the segment can be shared between unrelated