diff options
author | Mariano Pérez Rodríguez <mariano-perez-rodriguez@users.noreply.github.com> | 2015-02-07 14:02:33 -0300 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-03-18 11:29:32 +0100 |
commit | 586211ae60a9ad7a78dc8756355e3791e97794cb (patch) | |
tree | 6b8bd8c9ed4902e0091a275ded6956df07838528 | |
parent | 51a0ee1ed75015dfa2d2830df20dd320307e6404 (diff) | |
download | redis-586211ae60a9ad7a78dc8756355e3791e97794cb.tar.gz |
Fix for #2371
Fixing #2371 as per @mattsta's suggestion
-rw-r--r-- | src/config.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/config.h b/src/config.h index 61338fd19..5a3e77c90 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 @@ -86,9 +91,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 @@ -98,7 +100,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) |