]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/Monitor: use VOID_TEMP_FAILURE_RETRY wrapper for fd close().
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 4 May 2016 06:54:32 +0000 (14:54 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 5 May 2016 06:49:44 +0000 (14:49 +0800)
This is safer and much more robust.

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

index beea5e8b7b477be7aeec129b20366eb97a36d72c..71c3727005892b7dc788fd20357f032f019d8772 100644 (file)
@@ -86,6 +86,7 @@
 #include "common/config.h"
 #include "common/cmdparse.h"
 #include "include/assert.h"
+#include "include/compat.h"
 
 #define dout_subsys ceph_subsys_mon
 #undef dout_prefix
@@ -5018,7 +5019,7 @@ int Monitor::write_default_keyring(bufferlist& bl)
   err = bl.write_fd(fd);
   if (!err)
     ::fsync(fd);
-  ::close(fd);
+  VOID_TEMP_FAILURE_RETRY(::close(fd));
 
   return err;
 }