diff options
Diffstat (limited to 'ace/Map_Manager.cpp')
-rw-r--r-- | ace/Map_Manager.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp index eac0b35b103..69644237498 100644 --- a/ace/Map_Manager.cpp +++ b/ace/Map_Manager.cpp @@ -322,6 +322,9 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::bind_i (const EXT_ID &ext_id, ACE_TRACE ("ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::bind_i"); int first_free = -1; + // We need to save errno since <shared_find> may set errno to + // ENOENT. + int error = errno; int index = this->shared_find (ext_id, first_free); if (index >= 0) @@ -329,8 +332,12 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::bind_i (const EXT_ID &ext_id, return 1; else - // We didn't find it, so let's bind it! - return this->shared_bind (ext_id, int_id, first_free); + { + // Restore errno. + errno = error; + // We didn't find it, so let's bind it! + return this->shared_bind (ext_id, int_id, first_free); + } } // Associate <ext_id> with <int_id>. If <ext_id> is not in the |