summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2015-02-10 09:27:46 +0100
committerSalvatore Sanfilippo <antirez@gmail.com>2015-02-10 09:27:46 +0100
commit50a57c67b2050178487d119d56dc536a2fd661d1 (patch)
treecdcba862be56b52272aad414f869e88a4985937e
parentbd128f7969d0b28dbefe56bfdfa0b5b54102dc97 (diff)
parentc83a739bd8c9e6451414bcacade98733aeaa9834 (diff)
downloadredis-50a57c67b2050178487d119d56dc536a2fd661d1.tar.gz
Merge pull request #2372 from mariano-perez-rodriguez/patch-2
Fix HAVE_BACKTRACE on Linux
-rw-r--r--src/config.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/config.h b/src/config.h
index 1ed8ef301..c455ad9f0 100644
--- a/src/config.h
+++ b/src/config.h
@@ -34,6 +34,11 @@
#include <AvailabilityMacros.h>
#endif
+#ifdef __linux__
+#include <linux/version.h>
+#include <features.h>
+#endif
+
/* Define redis_fstat to fstat or fstat64() */
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
#define redis_fstat fstat64
@@ -91,9 +96,6 @@
/* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use
* the plain fsync() call. */
-#ifdef __linux__
-#include <linux/version.h>
-#include <features.h>
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
#if (LINUX_VERSION_CODE >= 0x020611 && __GLIBC_PREREQ(2, 6))
#define HAVE_SYNC_FILE_RANGE 1
@@ -103,7 +105,6 @@
#define HAVE_SYNC_FILE_RANGE 1
#endif
#endif
-#endif
#ifdef HAVE_SYNC_FILE_RANGE
#define rdb_fsync_range(fd,off,size) sync_file_range(fd,off,size,SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE)