]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
compat: define replacement TEMP_FAILURE_RETRY 917/head
authorNoah Watkins <noahwatkins@gmail.com>
Sun, 22 Sep 2013 18:02:34 +0000 (11:02 -0700)
committerNoah Watkins <noahwatkins@gmail.com>
Sat, 7 Dec 2013 18:18:51 +0000 (10:18 -0800)
Not all platforms have it.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
src/common/safe_io.c
src/include/compat.h
src/log/Log.cc
src/mon/LogMonitor.cc
src/tools/rados/rados.cc

index 16cc7293d9cd3d64a4f1f38017a4a28f7d173775..0b31157cd5116a477944a7781ff87485b2f9c280 100644 (file)
@@ -22,6 +22,7 @@
 #include <limits.h>
 
 #include "common/safe_io.h"
+#include "include/compat.h"
 
 ssize_t safe_read(int fd, void *buf, size_t count)
 {
index a410acb35f6135662ac95db0207806569c8456db..f9fd9a6f1f0b5e2928ff6a328f38939ed6264531 100644 (file)
 #if defined(__FreeBSD__)
 #define        lseek64(fd, offset, whence)     lseek(fd, offset, whence)
 #define        ENODATA 61
-#define        TEMP_FAILURE_RETRY
 #define        MSG_MORE 0
 #endif /* !__FreeBSD__ */
 
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(expression) ({     \
+  typeof(expression) __result;                \
+  do {                                        \
+    __result = (expression);                  \
+  } while (__result == -1 && errno == EINTR); \
+  __result; })
+#endif
+
 #endif /* !CEPH_COMPAT_H */
index afeb1208002e9bcfcb5bf4f332fd610ac1cf875d..f500e3ebf0a27b6a099f05e03afe05b0eb87c69b 100644 (file)
@@ -13,6 +13,7 @@
 #include "common/safe_io.h"
 #include "common/Clock.h"
 #include "include/assert.h"
+#include "include/compat.h"
 
 #define DEFAULT_MAX_NEW    100
 #define DEFAULT_MAX_RECENT 10000
index a545242577d29c1d9ea2567228abbf83d550e972..b60656f5f92c967bb53a7710a30dd0202edfbebb 100644 (file)
@@ -30,6 +30,7 @@
 #include "common/config.h"
 #include "include/assert.h"
 #include "include/str_list.h"
+#include "include/compat.h"
 
 #define dout_subsys ceph_subsys_mon
 #undef dout_prefix
index ad8eaa3e1a4a2563acd0dbc03730993a6696b9d6..6c349ad87e196355dbe9103d936cc4723ff8d1e0 100644 (file)
@@ -42,6 +42,7 @@ using namespace librados;
 #include <locale>
 
 #include "cls/lock/cls_lock_client.h"
+#include "include/compat.h"
 
 int rados_tool_sync(const std::map < std::string, std::string > &opts,
                              std::vector<const char*> &args);