diff options
author | Yossi Gottlieb <yossigo@gmail.com> | 2021-02-23 12:57:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-23 12:57:45 +0200 |
commit | 95ea74549cc454d6d6a7462b366462589cd96712 (patch) | |
tree | d80d70cdfc83604090b38025c7f7b075af205249 /src/config.h | |
parent | 8e83bcd2acb18370e2d6cea3718339792322e80f (diff) | |
download | redis-95ea74549cc454d6d6a7462b366462589cd96712.tar.gz |
Fix failed tests on Linux Alpine and add a CI job. (#8532)
* Remove linux/version.h dependency.
This introduces unnecessary dependencies, and generally not a good idea
as the platform we build on may be different than the platform we run
on.
To determine if sync_file_range exists we can simply rely on header file
hints.
* Fix setproctitle() on libmusl.
The previous ifdef checks were a bit too strict for no apparent
reason.
* Fix tests failure on Linux with no backtrace.
* Add alpine daily CI job.
Diffstat (limited to 'src/config.h')
-rw-r--r-- | src/config.h | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/config.h b/src/config.h index 1d4cb5835..56c1ab6ae 100644 --- a/src/config.h +++ b/src/config.h @@ -35,7 +35,6 @@ #endif #ifdef __linux__ -#include <linux/version.h> #include <features.h> #endif @@ -114,19 +113,7 @@ /* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use * the plain fsync() call. */ -#ifdef __linux__ -#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) -#if (LINUX_VERSION_CODE >= 0x020611 && __GLIBC_PREREQ(2, 6)) -#define HAVE_SYNC_FILE_RANGE 1 -#endif -#else -#if (LINUX_VERSION_CODE >= 0x020611) -#define HAVE_SYNC_FILE_RANGE 1 -#endif -#endif -#endif - -#ifdef HAVE_SYNC_FILE_RANGE +#if (defined(__linux__) && defined(SYNC_FILE_RANGE_WAIT_BEFORE)) #define rdb_fsync_range(fd,off,size) sync_file_range(fd,off,size,SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE) #else #define rdb_fsync_range(fd,off,size) fsync(fd) @@ -143,7 +130,7 @@ #define ESOCKTNOSUPPORT 0 #endif -#if ((defined __linux && defined(__GLIBC__)) || defined __APPLE__) +#if (defined __linux || defined __APPLE__) #define USE_SETPROCTITLE #define INIT_SETPROCTITLE_REPLACEMENT void spt_init(int argc, char *argv[]); |