diff options
author | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-01 16:52:17 +0000 |
---|---|---|
committer | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-12-01 16:52:17 +0000 |
commit | 037f7ed34eade43dd39edc377e733c938a51fe77 (patch) | |
tree | 1a5b844b48ed8c7299f8c740f7458bd2fcb9000e /ace/Memory_Pool.cpp | |
parent | 72cb7c072c7e3bf7e0a4e14e07e93c3b435efd45 (diff) | |
download | ATCD-037f7ed34eade43dd39edc377e733c938a51fe77.tar.gz |
Since type key_t might be something other than int (e.g., a long),
some additional code was needed to support the sscanf.
Diffstat (limited to 'ace/Memory_Pool.cpp')
-rw-r--r-- | ace/Memory_Pool.cpp | 5 |
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 |