From: xie xingguo Date: Wed, 4 May 2016 06:54:32 +0000 (+0800) Subject: mon/Monitor: use VOID_TEMP_FAILURE_RETRY wrapper for fd close(). X-Git-Tag: v11.0.0~573^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bfa40363b2d8fc25b4aed0164579d55137ac9e8b;p=ceph.git mon/Monitor: use VOID_TEMP_FAILURE_RETRY wrapper for fd close(). This is safer and much more robust. Signed-off-by: xie xingguo --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index beea5e8b7b47..71c372700589 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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; }