Skip to content

Commit

Permalink
Fix for redis#2371
Browse files Browse the repository at this point in the history
Fixing redis#2371 as per @mattsta's suggestion
  • Loading branch information
mariano-perez-rodriguez authored and antirez committed Mar 18, 2015
1 parent 51a0ee1 commit 586211a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 586211a

Please sign in to comment.