Commit 586211ae authored by Mariano Pérez Rodríguez's avatar Mariano Pérez Rodríguez Committed by antirez
Browse files

Fix for #2371

Fixing #2371 as per @mattsta's suggestion
parent 51a0ee1e
...@@ -34,6 +34,11 @@ ...@@ -34,6 +34,11 @@
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>
#endif #endif
#ifdef __linux__
#include <linux/version.h>
#include <features.h>
#endif
/* Define redis_fstat to fstat or fstat64() */ /* Define redis_fstat to fstat or fstat64() */
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) #if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
#define redis_fstat fstat64 #define redis_fstat fstat64
...@@ -86,9 +91,6 @@ ...@@ -86,9 +91,6 @@
/* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use /* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use
* the plain fsync() call. */ * the plain fsync() call. */
#ifdef __linux__
#include <linux/version.h>
#include <features.h>
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
#if (LINUX_VERSION_CODE >= 0x020611 && __GLIBC_PREREQ(2, 6)) #if (LINUX_VERSION_CODE >= 0x020611 && __GLIBC_PREREQ(2, 6))
#define HAVE_SYNC_FILE_RANGE 1 #define HAVE_SYNC_FILE_RANGE 1
...@@ -98,7 +100,6 @@ ...@@ -98,7 +100,6 @@
#define HAVE_SYNC_FILE_RANGE 1 #define HAVE_SYNC_FILE_RANGE 1
#endif #endif
#endif #endif
#endif
#ifdef HAVE_SYNC_FILE_RANGE #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) #define rdb_fsync_range(fd,off,size) sync_file_range(fd,off,size,SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment