]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/MemDB: use VOID_TEMP_FAILURE_RETRY wrapper to close fd
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 14 Jul 2016 10:55:10 +0000 (18:55 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 14 Jul 2016 11:33:52 +0000 (19:33 +0800)
Which is safer.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/kv/MemDB.cc

index 5135e6d1e295d18ba53a06838d6cdde961d3cbc9..8976e51f8cfb7a4df1a3563eee7813e5419bf6cf 100644 (file)
@@ -24,6 +24,7 @@
 #include "include/assert.h"
 #include "common/debug.h"
 #include "common/errno.h"
+#include "include/compat.h"
 
 #define dout_subsys ceph_subsys_memdb
 #undef dout_prefix
@@ -82,7 +83,7 @@ void MemDB::_save()
     iter++;
   }
 
-  ::close(fd);
+  VOID_TEMP_FAILURE_RETRY(::close(fd));
 }
 
 void MemDB::_load()
@@ -124,7 +125,7 @@ void MemDB::_load()
     dout(10) << __func__ << " Key:"<< key << dendl;
     m_btree[key] = datap;
   }
-  ::close(fd);
+  VOID_TEMP_FAILURE_RETRY(::close(fd));
 }
 
 int MemDB::_init(bool create)