]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
compat: move definitions in porting.h into include/compat.h
authorYan, Zheng <zyan@redhat.com>
Fri, 31 Jul 2015 02:01:01 +0000 (10:01 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 31 Aug 2015 08:00:27 +0000 (16:00 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/Makefile.am
src/include/Makefile.am
src/include/compat.h
src/include/sock_compat.h [new file with mode: 0644]
src/librbd/AsyncRequest.h
src/msg/async/AsyncConnection.cc
src/msg/simple/Pipe.cc
src/porting.h [deleted file]
src/rbd_fuse/rbd-fuse.cc
src/tools/ceph_objectstore_tool.cc

index 5cf555707f3a0e749227b49cb02e8338150c2b60..502f83a014fc48bed6f8a7dc3d083d97a1391a3d 100644 (file)
@@ -211,8 +211,7 @@ noinst_HEADERS += \
        bash_completion/radosgw-admin \
        mount/canonicalize.c \
        mount/mtab.c \
-       objclass/objclass.h \
-       porting.h
+       objclass/objclass.h
 
 
 # coverage
index 6369312d8e6f43ade6f4682941022d799259adbc..a364b295d6c25e7dcd77e69696ab776e7c44f60a 100644 (file)
@@ -61,6 +61,7 @@ noinst_HEADERS += \
        include/cmp.h \
        include/color.h \
        include/compat.h \
+       include/sock_compat.h \
        include/crc32c.h \
        include/encoding.h \
        include/err.h \
index caabe10df0e36566d1749b6bafd9e290846e0be1..9cb4f61b5327bc34587a912dde1668dcbdc9c074 100644 (file)
 #define        MSG_MORE 0
 #endif /* !__FreeBSD__ */
 
+#if defined(__APPLE__)
+/* PATH_MAX */
+#include <limits.h>
+
+/* O_LARGEFILE is not defined/required on OS X */
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
+/* Could be relevant for other platforms */
+#ifndef ERESTART
+#define ERESTART EINTR
+#endif
+#endif /* __APPLE__ */
+
 #ifndef TEMP_FAILURE_RETRY
 #define TEMP_FAILURE_RETRY(expression) ({     \
   typeof(expression) __result;                \
diff --git a/src/include/sock_compat.h b/src/include/sock_compat.h
new file mode 100644 (file)
index 0000000..5faacc3
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef CEPH_SOCK_COMPAT_H
+#define CEPH_SOCK_COMPAT_H
+
+#include "include/compat.h"
+
+/*
+ * This optimization may not be available on all platforms (e.g. OSX).
+ * Apparently a similar approach based on TCP_CORK can be used.
+ */
+#ifndef MSG_MORE
+# define MSG_MORE 0
+#endif
+
+/*
+ * On BSD SO_NOSIGPIPE can be set via setsockopt to block SIGPIPE.
+ */
+#ifndef MSG_NOSIGNAL
+# define MSG_NOSIGNAL 0
+# ifdef SO_NOSIGPIPE
+#  define CEPH_USE_SO_NOSIGPIPE
+# else
+#  error "Cannot block SIGPIPE!"
+# endif
+#endif
+
+#endif
index b6594bf8898e4bdeb2f3c82d14729e1d3d29a958..c0a60131106bc47962b78f9da04e952497cc04bb 100644 (file)
@@ -9,7 +9,7 @@
 #include "include/xlist.h"
 
 /* DARWIN Missing ERESTART */
-#include "porting.h"
+#include "include/compat.h"
 
 namespace librbd {
 
index a8a47e568dca1e53381d793403ff9057226c7cc3..97bb17ab20deb1afae7d3f268055dfb396f7a30e 100644 (file)
@@ -23,7 +23,7 @@
 #include "AsyncMessenger.h"
 #include "AsyncConnection.h"
 
-#include "porting.h"
+#include "include/sock_compat.h"
 
 // Constant to limit starting sequence number to 2^31.  Nothing special about it, just a big number.  PLR
 #define SEQ_MASK  0x7fffffff 
index 42995840d45a0363d1c37216650ef68912c84125..2292af9a54dd48b9d6cbb59f859fbf87b02ab55a 100644 (file)
@@ -32,7 +32,7 @@
 #include "auth/cephx/CephxProtocol.h"
 #include "auth/AuthSessionHandler.h"
 
-#include "porting.h"
+#include "include/sock_compat.h"
 
 // Constant to limit starting sequence number to 2^31.  Nothing special about it, just a big number.  PLR
 #define SEQ_MASK  0x7fffffff 
diff --git a/src/porting.h b/src/porting.h
deleted file mode 100644 (file)
index 1528ffb..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-
-#ifndef PORTING_H
-#define PORTING_H 
-#include "acconfig.h"
-
-/* TODO: move these into include/compat.h */
-
-#if defined(DARWIN) 
-#include <sys/socket.h>
-
-/* O_LARGEFILE is not defined/required on OS X */
-#define O_LARGEFILE 0
-
-/* Wonder why this is missing */
-#define PATH_MAX 1024
-
-/* Could be relevant for other platforms */
-#ifndef ERESTART
-#define ERESTART EINTR
-#endif
-
-/*
- * This optimization may not be available on all platforms (e.g. OSX).
- * Apparently a similar approach based on TCP_CORK can be used.
- */
-#ifndef MSG_MORE
-# define MSG_MORE 0
-#endif
-
-/*
- * On BSD SO_NOSIGPIPE can be set via setsockopt to block SIGPIPE.
- */
-#ifndef MSG_NOSIGNAL
-# define MSG_NOSIGNAL 0
-# ifdef SO_NOSIGPIPE
-#  define CEPH_USE_SO_NOSIGPIPE
-# else
-#  error "Cannot block SIGPIPE!"
-# endif
-#endif
-
-#endif /* DARWIN */
-#endif /* PORTING_H */
index f7ac46c7677837c662502db30699f3ad0dee24b4..5cc89002c4f951f432c785587e6ee7a903219530 100644 (file)
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
-#if defined(DARWIN) 
 #include <fuse.h>
-#include "porting.h"
-#else
-#include <fuse.h>
-#endif
 #include <pthread.h>
 #include <string.h>
 #include <sys/types.h>
@@ -24,6 +19,7 @@
 #include <getopt.h>
 #include <assert.h>
 
+#include "include/compat.h"
 #include "include/rbd/librbd.h"
 
 static int gotrados = 0;
index dd29779fd7b864b93bcbd81c5396e60fe64bf2ba..a2dbccbc5fc208df307b20d810e00a853529d87b 100644 (file)
@@ -36,7 +36,6 @@
 #include "json_spirit/json_spirit_reader.h"
 
 #include "ceph_objectstore_tool.h"
-#include "porting.h"
 
 namespace po = boost::program_options;
 using namespace std;